
import { difference, polygon } from "@turf/turf";
import { Path, Shape, Vector2, Vector3 } from "three";
import CommonUtils from "./CommonUtils";
import { BIM } from "./BIM";
import VectorUtils from "./VectorUtils";
import AModelFmulaUtils from "./AModelFmulaUtils";
import { AK, XQType } from "./enum";
import ConstDef from "./ConstDef";

export default class SlotUtils {

    static getTLkw(tldw: string, sinA: number, cosA: number, polygon: Vector2[], r: string = '10') {
        let gmtpos = AModelFmulaUtils.getHolesbyExpress(tldw, 0, 3);
        if (gmtpos && gmtpos.length > 0) {
            let truepoint: string[] = [];
            let oldstr: string[] = [];
            let tmp: Vector2 = new Vector2();
            for (let i = 0; i < gmtpos.length; i++) {
                let tmppath = CommonUtils.getCornerPath(0, gmtpos[i].x, gmtpos[i].x, gmtpos[i].y, gmtpos[i].y, sinA, cosA);
                tmp.set(tmppath[2].x, tmppath[2].y)
                let pinpolygon = VectorUtils.pointInPolygon(tmp, polygon);
                if (pinpolygon) {
                    let mindis = CommonUtils.getPointToLineMinDistance(tmp, polygon, CommonUtils.getRadius(r) + 10);
                    if (mindis < CommonUtils.getRadius(r) + 10) {
                        continue;
                    }

                    truepoint.push("(" + tmppath[2].x + "," + tmppath[2].y + ")");
                    oldstr.push("(" + gmtpos[i].x + "," + gmtpos[i].y + ")")
                }
            }
            let str = truepoint.join(",");
            let old = oldstr.join(",");
            return [str, old];
        }
        return ["", tldw];
    }

    /**
    * 易拆
    * @param count 
    * @param vertices 
    * @param indices 
    * @param facevec 
    * @param holes 
    * @param lbv 左斜
    * @param rbv 右斜
    * @param W 宽
    * @param H 高
    * @param HC 高度对应的三角斜边长
    * @param XQNXJL 斜切距离
    * @param BKH 边框高
    * @param SXKH 上下框厚
    * @param len 定位
    * @param isLeft 是否是左斜切
    * @returns 
    */
    static getYiChaiVI(count: number, vertices: any[], indices: any[], facevec: any[], holes: Path[], lbv: number, rbv: number,
        W: number, H: number, HC: number, XQNXJL: number, BKH: number, SXKH: number, len: number, isLeft: boolean): number {

        let cosB = H / HC;
        let sinB = XQNXJL / HC;
        let path = [
            new Vector2(0, 0),
            new Vector2(0, W),
            new Vector2(BKH / cosB, (W + lbv)),
            new Vector2(BKH / cosB, BKH),
            new Vector2((H + rbv) / cosB, BKH),
            new Vector2(H / cosB, 0)
        ]

        let i: number, tpy: number, bpy: number, yv: number;
        let top: Vector3, bottom: Vector3;
        let topface = [];
        let bottomface = [];
        for (i = 0; i < path.length; i++) {

            tpy = isLeft ? len + path[i].x * sinB : len - path[i].x * sinB;
            top = new Vector3(path[i].x * cosB, tpy, path[i].y);

            bpy = isLeft ? len - SXKH + path[i].x * sinB : len - SXKH - path[i].x * sinB;
            bottom = new Vector3(path[i].x * cosB, bpy, path[i].y);

            topface.push(top);
            bottomface.push(bottom);
        }

        let topvec = topface.concat(topface[0].clone());
        let bottomvec = bottomface.concat(bottomface[0].clone());

        let side: any[];
        if (!BIM.simpleMold) {
            // 侧边
            side = CommonUtils.getSideVIF(bottomvec, topvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        topface = [];
        bottomface = [];
        for (i = 0; i < path.length; i++) {

            tpy = isLeft ? len + path[i].x * sinB : len - path[i].x * sinB;
            top = new Vector3(path[i].x * cosB, tpy, path[i].y);

            bpy = isLeft ? len + SXKH + path[i].x * sinB : len + SXKH - path[i].x * sinB;
            bottom = new Vector3(path[i].x * cosB, bpy, path[i].y);

            topface.push(top);
            bottomface.push(bottom);
        }

        topvec = topface.concat(topface[0].clone());
        bottomvec = bottomface.concat(bottomface[0].clone());

        // 侧边
        if (!BIM.simpleMold) {
            side = CommonUtils.getSideVIF(topvec, bottomvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        // 前后面
        let shape = new Shape().setFromPoints(path);
        // 挖孔
        if (holes && holes.length > 0) {
            let tmpholes = CommonUtils.getHoleByDivisions(holes);
            shape.holes.push(...tmpholes);
        }

        let geometry = CommonUtils.getShapeData(shape);
        let positionAry = geometry[0];
        let indexAry = geometry[1];
        shape = null;

        // 顶点
        let vertex: any[] = []
        let index: any[] = [];

        for (let i = 0; i < positionAry.length; i += 3) {

            let a = positionAry[i];
            let b = positionAry[i + 1];
            // let c = positionAry[i + 2];

            yv = isLeft ? len + a * sinB : len - a * sinB;
            vertex.push(a * cosB, yv, b);
        }

        // 索引
        for (let i = 0; i < indexAry.length; i += 3) {
            let a = indexAry[i] + count;
            let b = indexAry[i + 1] + count;
            let c = indexAry[i + 2] + count;

            index.push(a, b, c);
        }

        index.reverse();
        vertices.push(...vertex);
        indices.push(...index);
        facevec.push(topface);

        count = Math.max(...indices) + 1;


        // 顶点
        if (!BIM.simpleMold) {
            vertex = []
            index = [];

            for (let i = 0; i < positionAry.length; i += 3) {

                let a = positionAry[i];
                let b = positionAry[i + 1];
                // let c = positionAry[i + 2];
                yv = isLeft ? len - SXKH + a * sinB : len - SXKH - a * sinB;
                vertex.push(a * cosB, yv, b);
            }

            // 索引
            for (let i = 0; i < indexAry.length; i += 3) {
                let a = indexAry[i] + count;
                let b = indexAry[i + 1] + count;
                let c = indexAry[i + 2] + count;

                index.push(a, b, c);
            }


            vertices.push(...vertex);
            indices.push(...index);
            facevec.push(bottomface);

            count = Math.max(...indices) + 1;

            vertex = []
            index = [];

            for (let i = 0; i < positionAry.length; i += 3) {

                let a = positionAry[i];
                let b = positionAry[i + 1];
                // let c = positionAry[i + 2];

                yv = isLeft ? len + SXKH + a * sinB : len + SXKH - a * sinB;
                vertex.push(a * cosB, yv, b);
            }

            // 索引
            for (let i = 0; i < indexAry.length; i += 3) {
                let a = indexAry[i] + count;
                let b = indexAry[i + 1] + count;
                let c = indexAry[i + 2] + count;

                index.push(a, b, c);
            }

            index.reverse();
            vertices.push(...vertex);
            indices.push(...index);
            facevec.push(bottomface);

            count = Math.max(...indices) + 1;
        }
        //geometry.dispose();
        return count;
    }

    static getRightSlotGapPath(data: ALParams, xzioxie: number[], syioxie: number[], L: number, H: number, len: number,
        islptx: boolean, p_yklpcdw?: number[]): any[] {

        let QKH: number = Number(data.p_qkh);
        let QKW: number = Number(data.p_qkw);


        // 拉片宽厚
        let p_lpck: number = Number(data.p_lpck);
        let p_lpch: number = Number(data.p_lpch);
        let yposAry = [];

        let frontPath = [
            [0, 0 + xzioxie[12]],
            [H + len, 0 + xzioxie[13]],
            [H + len, L + syioxie[13]],
            [0, L + syioxie[12]],
            [0, 0 + xzioxie[12]],
        ];

        let backPath = [
            [0, 0 + xzioxie[0]],
            [H, 0 + xzioxie[5]],
            [H, L + syioxie[5]],
            [0, L + syioxie[0]],
            [0, 0 + xzioxie[0]],
        ];

        let fronpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let i: number;
        let fd, bd;
        let backdiff: any;
        let frontdiff: any;

        let rightpos: number = 0;

        if (QKH > 0 && QKW > 0) {

            let ykqkdw = data.p_ykqkdw;
            let ykqkdwAry = CommonUtils.getQKAry(ykqkdw, L)
            if (ykqkdwAry.length > 0) {
                for (i = 0; i < ykqkdwAry.length; i++) {
                    rightpos += Number(ykqkdwAry[i]);
                    yposAry.push([rightpos - QKW / 2, rightpos + QKW / 2]);
                    if (rightpos > 0) {
                        let fpath = [
                            [H + len - QKH, rightpos - QKW / 2],
                            [H + len, rightpos - QKW / 2],
                            [H + len, rightpos + QKW / 2],
                            [H + len - QKH, rightpos + QKW / 2],
                            [H + len - QKH, rightpos - QKW / 2],
                        ]

                        let bpath = [
                            [H - QKH, rightpos - QKW / 2],
                            [H, rightpos - QKW / 2],
                            [H, rightpos + QKW / 2],
                            [H - QKH, rightpos + QKW / 2],
                            [H - QKH, rightpos - QKW / 2],
                        ]

                        let fpoly = polygon([fpath]);
                        let bpoly = polygon([bpath])

                        frontdiff = difference(fronpoly, fpoly);
                        backdiff = difference(backpoly, bpoly);

                        fd = frontdiff.geometry.coordinates;
                        bd = backdiff.geometry.coordinates;
                        if (fd.length > 1) {
                            fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                        }
                        if (bd.length > 1) {
                            bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                        }
                        fronpoly = polygon(fd);
                        backpoly = polygon(bd);
                    }
                }
            }

        }

        if (islptx) {

            if (p_yklpcdw.length > 0) {
                for (i = 0; i < p_yklpcdw.length; i++) {
                    rightpos = Number(p_yklpcdw[i]);

                    if (rightpos > 0 && CommonUtils.pathxj(rightpos - p_lpck / 2, rightpos + p_lpck / 2, yposAry)) {
                        let fpath = [
                            [H + len - p_lpch, rightpos - p_lpck / 2],
                            [H + len, rightpos - p_lpck / 2],
                            [H + len, rightpos + p_lpck / 2],
                            [H + len - p_lpch, rightpos + p_lpck / 2],
                            [H + len - p_lpch, rightpos - p_lpck / 2],
                        ]

                        let bpath = [
                            [H - p_lpch, rightpos - p_lpck / 2],
                            [H, rightpos - p_lpck / 2],
                            [H, rightpos + p_lpck / 2],
                            [H - p_lpch, rightpos + p_lpck / 2],
                            [H - p_lpch, rightpos - p_lpck / 2],
                        ]

                        let fpoly = polygon([fpath]);
                        let bpoly = polygon([bpath])

                        frontdiff = difference(fronpoly, fpoly);
                        backdiff = difference(backpoly, bpoly);

                        fd = frontdiff.geometry.coordinates;
                        bd = backdiff.geometry.coordinates;
                        if (fd.length > 1) {
                            fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                        }
                        if (bd.length > 1) {
                            bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                        }
                        fronpoly = polygon(fd);
                        backpoly = polygon(bd);
                    }
                }
            }

        }

        let frontpathVec: any[] = [];
        let backpathVec: any[] = [];
        if (fd && fd.length > 0) {
            for (let i = 0; i < fd[0].length; i++) {
                frontpathVec.push(new Vector2(fd[0][i][0], fd[0][i][1]));
            }
        }
        if (bd && bd.length > 0) {
            for (let i = 0; i < bd[0].length; i++) {
                backpathVec.push(new Vector2(bd[0][i][0], bd[0][i][1]));
            }
        }
        return [frontpathVec, backpathVec];
    }

    static getLeftSlotGapPath(data: ALParams, xzioxie: number[], syioxie: number[], L: number, W: number, len: number,
        islptx: boolean, p_zklpcdw?: number[]): any[] {

        let QKH: number = Number(data.p_qkh);
        let QKW: number = Number(data.p_qkw);

        // 拉片宽厚
        let p_lpck: number = Number(data.p_lpck);
        let p_lpch: number = Number(data.p_lpch);
        let zposAry = [];

        let frontPath = [
            [0 + xzioxie[0], 0],
            [L + syioxie[0], 0],
            [L + syioxie[1], W],
            [0 + xzioxie[1], W],
            [0 + xzioxie[0], 0],
        ];

        let backPath = [
            [0 + xzioxie[6], 0],
            [L + syioxie[6], 0],
            [L + syioxie[7], W + len],
            [0 + xzioxie[7], W + len],
            [0 + xzioxie[6], 0],
        ];

        let fronpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let fd, bd;
        let i: number, j: number;
        let backdiff: any;
        let frontdiff: any;
        let leftpos: number = 0;
        if (QKH > 0 && QKW > 0) {

            let zkqkdw = data.p_zkqkdw;
            let zkqkdwAry = CommonUtils.getQKAry(zkqkdw, L)
            if (zkqkdwAry.length > 0) {
                for (i = 0; i < zkqkdwAry.length; i++) {
                    leftpos += Number(zkqkdwAry[i]);
                    zposAry.push([leftpos - QKW / 2, leftpos + QKW / 2]);
                    if (leftpos > 0) {
                        let leftpathf = [
                            [leftpos - QKW / 2, W],
                            [leftpos - QKW / 2, W - QKH],
                            [leftpos + QKW / 2, W - QKH],
                            [leftpos + QKW / 2, W],

                            [leftpos - QKW / 2, W]
                        ]

                        let leftpathb = [
                            [leftpos - QKW / 2, W + len],
                            [leftpos - QKW / 2, W + len - QKH],
                            [leftpos + QKW / 2, W + len - QKH],
                            [leftpos + QKW / 2, W + len],

                            [leftpos - QKW / 2, W + len]
                        ]

                        let fpoly = polygon([leftpathf]);
                        let bpoly = polygon([leftpathb])

                        frontdiff = difference(fronpoly, fpoly);
                        backdiff = difference(backpoly, bpoly);

                        fd = frontdiff.geometry.coordinates;
                        bd = backdiff.geometry.coordinates;

                        if (fd.length > 1) {
                            fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                        }
                        if (bd.length > 1) {
                            bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                        }
                        fronpoly = polygon(fd);
                        backpoly = polygon(bd);
                    }
                }
            }
        }

        if (islptx) {

            if (p_zklpcdw.length > 0) {
                for (i = 0; i < p_zklpcdw.length; i++) {
                    leftpos = Number(p_zklpcdw[i]);
                    if (leftpos > 0 && CommonUtils.pathxj(leftpos - p_lpck / 2, leftpos + p_lpck / 2, zposAry)) {
                        let leftpathf = [
                            [leftpos - p_lpck / 2, W],
                            [leftpos - p_lpck / 2, W - p_lpch],
                            [leftpos + p_lpck / 2, W - p_lpch],
                            [leftpos + p_lpck / 2, W],

                            [leftpos - p_lpck / 2, W]
                        ]

                        let leftpathb = [
                            [leftpos - p_lpck / 2, W + len],
                            [leftpos - p_lpck / 2, W + len - p_lpch],
                            [leftpos + p_lpck / 2, W + len - p_lpch],
                            [leftpos + p_lpck / 2, W + len],

                            [leftpos - p_lpck / 2, W + len]
                        ]

                        let fpoly = polygon([leftpathf]);
                        let bpoly = polygon([leftpathb])

                        frontdiff = difference(fronpoly, fpoly);
                        backdiff = difference(backpoly, bpoly);

                        fd = frontdiff.geometry.coordinates;
                        bd = backdiff.geometry.coordinates;

                        if (fd.length > 1) {
                            fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                        }
                        if (bd.length > 1) {
                            bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                        }
                        fronpoly = polygon(fd);
                        backpoly = polygon(bd);
                    }
                }
            }
        }

        let frontpathVec: any[] = [];
        let backpathVec: any[] = [];
        if (fd && fd.length > 0) {
            for (let i = 0; i < fd[0].length; i++) {
                frontpathVec.push(new Vector2(fd[0][i][0], fd[0][i][1]));
            }
        }
        if (bd && bd.length > 0) {
            for (let i = 0; i < bd[0].length; i++) {
                backpathVec.push(new Vector2(bd[0][i][0], bd[0][i][1]));
            }
        }
        return [frontpathVec, backpathVec];
    }

    static getNormalSlotLeftGapPath(iswall: boolean, data: ALParams, len: number,
        DJXQW: number, DJXQH: number, xzioxie: number[], syioxie: number[],
        islptx: boolean = false, kw: number[] = null) {

        let L: number = Number(data.L);
        // 缺口
        let QKH: number = Number(data.p_qkh);
        let QKW: number = Number(data.p_qkw);

        let p_lpck: number = Number(data.p_lpck);

        let frontPath: number[][], backPath: number[][];
        if (iswall) {
            frontPath = [
                [0, 0],
                [len - DJXQW, 0],
                [len, DJXQH],
                [len, L],
                [0, L],
                [0, 0]
            ]

            backPath = [
                [0, 0],
                [len - DJXQW, 0],
                [len, DJXQH],
                [len, L],
                [0, L],
                [0, 0]
            ]
        }
        else {
            frontPath = [
                [0, 0 + xzioxie[1]],
                [len, 0 + xzioxie[2]],
                [len, L + syioxie[2]],
                [0, L + syioxie[1]],
                [0, 0 + xzioxie[1]]
            ]

            backPath = [
                [0, 0 + xzioxie[8]],
                [len, 0 + xzioxie[9]],
                [len, L + syioxie[9]],
                [0, L + syioxie[8]],
                [0, 0 + xzioxie[8]]
            ]
        }
        let fisone = false;
        let bisone = false;
        let frontpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let fpathVec: number[][], bpathVec: number[][];
        let fdiff: any, bdiff: any;
        let fresult: any[] = [];
        let bresult: any[] = [];
        let i: number, j: number;

        let leftpos: number = 0;

        let zposAry = []; //缺口范围
        let zlpfAry = [];
        let zlpbAry = [];

        // 缺口
        if (QKH > 0 && QKW > 0) {


            let zkqkdw = data.p_zkqkdw;
            let zkqkdwAry = CommonUtils.getQKAry(zkqkdw, L);
            if (zkqkdwAry.length > 0) {

                for (i = 0; i < zkqkdwAry.length; i++) {
                    leftpos += Number(zkqkdwAry[i]);
                    zposAry.push([leftpos - QKW / 2, leftpos + QKW / 2]);
                    if (leftpos > 0) {

                        let walltp = leftpos + QKW / 2;
                        let wallbp = leftpos - QKW / 2;

                        if (iswall) {

                            let walltlen: number;
                            if (walltp >= 0 && walltp < DJXQH) {
                                walltlen = walltp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                walltlen = len;
                            }

                            let wallblen: number;
                            if (wallbp >= 0 && wallbp < DJXQH) {
                                wallblen = wallbp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                wallblen = len;
                            }

                            fpathVec = [
                                [0, wallbp],
                                [wallblen, wallbp],
                                [walltlen, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]
                            bpathVec = [
                                [0, wallbp],
                                [wallblen, wallbp],
                                [walltlen, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]
                        }
                        else {
                            fpathVec = [
                                [0, wallbp],
                                [len, wallbp],
                                [len, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]

                            bpathVec = [
                                [0, wallbp],
                                [len, wallbp],
                                [len, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]
                        }

                        let tpoly = polygon([fpathVec]);
                        let bpoly = polygon([bpathVec]);

                        let fg = difference(frontpoly, tpoly);
                        fdiff = fg.geometry.coordinates;

                        if (fdiff && fdiff.length > 0) {
                            fisone = fdiff.length === 1;
                            if (fisone) {
                                // fresult = fresult.concat(fdiff);
                                frontpoly = polygon(fdiff)
                            }
                            else {
                                fresult = fresult.concat(fdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                        }

                        let bg = difference(backpoly, bpoly);
                        bdiff = bg.geometry.coordinates;

                        if (bdiff && bdiff.length > 0) {
                            bisone = bdiff.length === 1;
                            if (bisone) {
                                // bresult = bresult.concat(bdiff);
                                backpoly = polygon(bdiff)
                            }
                            else {
                                bresult = bresult.concat(bdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (bdiff.length > 1) backpoly = polygon(bdiff[1]);
                        }
                    }
                }
                fresult = fresult.concat(frontpoly.geometry.coordinates);
                bresult = bresult.concat(backpoly.geometry.coordinates);
            }
        }

        if (islptx) {

            let p_zklpcdw = AModelFmulaUtils.getHolesbyExpress(data.p_zklpcdw, L, 2, data, AK.p_zklpcdw);
            if (p_zklpcdw.length > 0) {

                for (i = 0; i < p_zklpcdw.length; i++) {
                    leftpos = Number(p_zklpcdw[i]);

                    if (leftpos > 0 && CommonUtils.pathxj(leftpos - p_lpck / 2, leftpos + p_lpck / 2, zposAry)) {

                        let walltp = leftpos + p_lpck / 2;
                        let wallbp = leftpos - p_lpck / 2;

                        if (iswall) {

                            let walltlen: number;
                            if (walltp >= 0 && walltp < DJXQH) {
                                walltlen = walltp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                walltlen = len;
                            }

                            let wallblen: number;
                            if (wallbp >= 0 && wallbp < DJXQH) {
                                wallblen = wallbp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                wallblen = len;
                            }

                            fpathVec = [
                                [0, wallbp],
                                [wallblen, wallbp],
                                [walltlen, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]
                            bpathVec = [
                                [0, wallbp],
                                [wallblen, wallbp],
                                [walltlen, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]
                        }
                        else {
                            fpathVec = [
                                [0, wallbp],
                                [len, wallbp],
                                [len, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]

                            bpathVec = [
                                [0, wallbp],
                                [len, wallbp],
                                [len, walltp],
                                [0, walltp],
                                [0, wallbp]
                            ]
                        }

                        let tpoly = polygon([fpathVec]);
                        let bpoly = polygon([bpathVec]);

                        let fg = difference(frontpoly, tpoly);
                        fdiff = fg.geometry.coordinates;

                        if (fdiff && fdiff.length > 0) {
                            fisone = fdiff.length === 1;
                            if (fisone) {
                                // fresult = fresult.concat(fdiff);
                                frontpoly = polygon(fdiff)
                            }
                            else {
                                fresult = fresult.concat(fdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                        }

                        let bg = difference(backpoly, bpoly);
                        bdiff = bg.geometry.coordinates;

                        if (bdiff && bdiff.length > 0) {
                            bisone = bdiff.length === 1;
                            if (bisone) {
                                // bresult = bresult.concat(bdiff);
                                backpoly = polygon(bdiff)
                            }
                            else {
                                bresult = bresult.concat(bdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (bdiff.length > 1) backpoly = polygon(bdiff[1]);
                        }

                        zlpfAry.push(fpathVec); //路径
                        zlpbAry.push(bpathVec)
                        if (kw) kw.push(leftpos); // 孔位
                    }
                }
                fresult = fresult.concat(frontpoly.geometry.coordinates);
                bresult = bresult.concat(backpoly.geometry.coordinates);
            }
        }

        let ftarget: any[] = [];
        let foneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            foneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                foneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            ftarget.push(foneVec);
        }

        let btarget: any[] = [];
        let oneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            oneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                oneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            btarget.push(oneVec);
        }

        let flp: any[] = [];
        let blp: any[] = [];
        if (zlpfAry.length > 0) {
            for (i = 0; i < zlpfAry.length; i++) {
                foneVec = [];
                for (j = 0; j < zlpfAry[i].length; j++) {
                    foneVec.push(new Vector2(zlpfAry[i][j][0], zlpfAry[i][j][1]));
                }
                flp.push(foneVec);
            }

            for (i = 0; i < zlpbAry.length; i++) {
                oneVec = [];
                for (j = 0; j < zlpbAry[i].length; j++) {
                    oneVec.push(new Vector2(zlpbAry[i][j][0], zlpbAry[i][j][1]));
                }
                blp.push(oneVec);
            }
        }



        return { front: ftarget, back: btarget, frontlp: flp, backlp: blp };
    }

    static getNormalSlotRightGapPath(iswall: boolean, data: ALParams, len: number,
        DJXQW: number, DJXQH: number, xzioxie: number[], syioxie: number[],
        islptx: boolean = false, kw: number[] = null) {

        let W: number = Number(data.W);
        let L: number = Number(data.L);
        // 缺口
        let QKH: number = Number(data.p_qkh);
        let QKW: number = Number(data.p_qkw);

        let p_lpck: number = Number(data.p_lpck);

        let frontPath: number[][], backPath: number[][];
        if (iswall) {
            frontPath = [
                [0, 0],
                [0, len - DJXQW],
                [DJXQH, len],
                [L, len],
                [L, 0],
                [0, 0]
            ]

            backPath = [
                [0, 0],
                [0, len - DJXQW],
                [DJXQH, len],
                [L, len],
                [L, 0],
                [0, 0]
            ]
        }
        else {
            frontPath = [
                [0 + xzioxie[5], 0],
                [0 + xzioxie[4], len],
                [L + syioxie[4], len],
                [L + syioxie[5], 0],
                [0 + xzioxie[5], 0]
            ]

            backPath = [
                [0 + xzioxie[11], 0],
                [0 + xzioxie[10], len],
                [L + syioxie[10], len],
                [L + syioxie[11], 0],
                [0 + xzioxie[11], 0]
            ]
        }

        let frontpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let i: number, j: number;
        let fpathVec: number[][], bpathVec: number[][];
        let fdiff: any, bdiff: any;

        let fisone = false;
        let bisone = false;
        let fresult: any[] = [];
        let bresult: any[] = [];
        let righttpos: number = 0;

        let yposAry = []; //缺口范围
        let ylpfAry = [];
        let ylpbAry = [];

        // 缺口
        if (QKH > 0 && QKW > 0) {


            let ykqkdw = data.p_ykqkdw;
            let ykqkdwAry = CommonUtils.getQKAry(ykqkdw, L);
            if (ykqkdwAry.length > 0) {

                for (i = 0; i < ykqkdwAry.length; i++) {
                    righttpos += Number(ykqkdwAry[i]);
                    yposAry.push([righttpos - QKW / 2, righttpos + QKW / 2]);
                    if (righttpos > 0) {

                        let walltp = righttpos + QKW / 2;
                        let wallbp = righttpos - QKW / 2;

                        if (iswall) {

                            let walltlen: number;
                            if (walltp >= 0 && walltp < DJXQH) {
                                walltlen = walltp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                walltlen = len;
                            }

                            let wallblen: number;
                            if (wallbp >= 0 && wallbp < DJXQH) {
                                wallblen = wallbp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                wallblen = len;
                            }

                            fpathVec = [
                                [wallbp, 0],
                                [wallbp, wallblen],
                                [walltp, walltlen],
                                [walltp, 0],
                                [wallbp, 0]
                            ]
                            bpathVec = [
                                [wallbp, 0],
                                [wallbp, wallblen],
                                [walltp, walltlen],
                                [walltp, 0],
                                [wallbp, 0]
                            ]
                        }
                        else {
                            fpathVec = [
                                [wallbp, 0],
                                [wallbp, len],
                                [walltp, len],
                                [walltp, 0],
                                [wallbp, 0]
                            ]

                            bpathVec = [
                                [wallbp, 0],
                                [wallbp, len],
                                [walltp, len],
                                [walltp, 0],
                                [wallbp, 0]
                            ]
                        }

                        let tpoly = polygon([fpathVec]);
                        let bpoly = polygon([bpathVec]);

                        let fg = difference(frontpoly, tpoly);
                        fdiff = fg.geometry.coordinates;


                        if (fdiff && fdiff.length > 0) {
                            fisone = fdiff.length === 1;
                            if (fisone) {
                                // fresult = fresult.concat(fdiff);
                                frontpoly = polygon(fdiff)
                            }
                            else {
                                fresult = fresult.concat(fdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                        }

                        let bg = difference(backpoly, bpoly);
                        bdiff = bg.geometry.coordinates;

                        if (bdiff && bdiff.length > 0) {
                            bisone = bdiff.length === 1;
                            if (bisone) {
                                // bresult = bresult.concat(bdiff);
                                backpoly = polygon(bdiff)
                            }
                            else {
                                bresult = bresult.concat(bdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (bdiff.length > 1) backpoly = polygon(bdiff[1]);
                        }
                    }
                }

                fresult = fresult.concat(frontpoly.geometry.coordinates);
                bresult = bresult.concat(backpoly.geometry.coordinates);
            }

        }

        if (islptx) {

            let p_yklpcdw = AModelFmulaUtils.getHolesbyExpress(data.p_yklpcdw, L, 2, data, AK.p_yklpcdw);
            if (p_yklpcdw.length > 0) {



                for (i = 0; i < p_yklpcdw.length; i++) {
                    righttpos = Number(p_yklpcdw[i]);

                    if (righttpos > 0 && CommonUtils.pathxj(righttpos - p_lpck / 2, righttpos + p_lpck / 2, yposAry)) {

                        let walltp = righttpos + p_lpck / 2;
                        let wallbp = righttpos - p_lpck / 2;

                        if (iswall) {

                            let walltlen: number;
                            if (walltp >= 0 && walltp < DJXQH) {
                                walltlen = walltp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                walltlen = len;
                            }

                            let wallblen: number;
                            if (wallbp >= 0 && wallbp < DJXQH) {
                                wallblen = wallbp / DJXQH * DJXQW + len - DJXQW
                            }
                            else {
                                wallblen = len;
                            }

                            fpathVec = [
                                [wallbp, 0],
                                [wallbp, wallblen],
                                [walltp, walltlen],
                                [walltp, 0],
                                [wallbp, 0]
                            ]
                            bpathVec = [
                                [wallbp, 0],
                                [wallbp, wallblen],
                                [walltp, walltlen],
                                [walltp, 0],
                                [wallbp, 0]
                            ]
                        }
                        else {
                            fpathVec = [
                                [wallbp, 0],
                                [wallbp, len],
                                [walltp, len],
                                [walltp, 0],
                                [wallbp, 0]
                            ]

                            bpathVec = [
                                [wallbp, 0],
                                [wallbp, len],
                                [walltp, len],
                                [walltp, 0],
                                [wallbp, 0]
                            ]
                        }

                        let tpoly = polygon([fpathVec]);
                        let bpoly = polygon([bpathVec]);

                        let fg = difference(frontpoly, tpoly);
                        fdiff = fg.geometry.coordinates;


                        if (fdiff && fdiff.length > 0) {
                            fisone = fdiff.length === 1;
                            if (fisone) {
                                // fresult = fresult.concat(fdiff);
                                frontpoly = polygon(fdiff)
                            }
                            else {
                                fresult = fresult.concat(fdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                        }

                        let bg = difference(backpoly, bpoly);
                        bdiff = bg.geometry.coordinates;

                        if (bdiff && bdiff.length > 0) {
                            bisone = bdiff.length === 1;
                            if (bisone) {
                                // bresult = bresult.concat(bdiff);
                                backpoly = polygon(bdiff)
                            }
                            else {
                                bresult = bresult.concat(bdiff[0]);
                            }
                            // result = result.concat(dd[0]);
                            if (bdiff.length > 1) backpoly = polygon(bdiff[1]);
                        }

                        ylpfAry.push(fpathVec); //路径
                        ylpbAry.push(bpathVec)
                        if (kw) kw.push(righttpos); // 孔位
                    }
                }

                fresult = fresult.concat(frontpoly.geometry.coordinates);
                bresult = bresult.concat(backpoly.geometry.coordinates);
            }
        }

        let ftarget: any[] = [];
        let foneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            foneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                foneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            ftarget.push(foneVec);
        }

        let btarget: any[] = [];
        let oneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            oneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                oneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            btarget.push(oneVec);
        }

        let flp: any[] = [];
        let blp: any[] = [];
        if (ylpfAry.length > 0) {
            for (i = 0; i < ylpfAry.length; i++) {
                foneVec = [];
                for (j = 0; j < ylpfAry[i].length; j++) {
                    foneVec.push(new Vector2(ylpfAry[i][j][0], ylpfAry[i][j][1]));
                }
                flp.push(foneVec);
            }

            for (i = 0; i < ylpbAry.length; i++) {
                oneVec = [];
                for (j = 0; j < ylpbAry[i].length; j++) {
                    oneVec.push(new Vector2(ylpbAry[i][j][0], ylpbAry[i][j][1]));
                }
                blp.push(oneVec);
            }
        }

        return { front: ftarget, back: btarget, frontlp: flp, backlp: blp };
    }

    static getLeftSlotFengVI(count: number, vertices: number[], indices: number[], facevec: any[],
        fone: Vector2[], bone: Vector2[], holes: Path[], W: number, cosA: number, sinA: number,
        data: ALParams, kongtype: string, islptx: boolean = false, oz: number = 0): number {

        let topface: Vector3[] = [];
        let bottomface: Vector3[] = [];
        let top: Vector3, bottom: Vector3;
        let adv = data.p_zksctype === XQType.nx ? - cosA : data.p_zksctype === XQType.wx ? cosA : 0;

        for (let i = 0; i < fone.length; i++) {
            top = new Vector3(fone[i].x * sinA, fone[i].y, W - data.ZYKH + fone[i].x * adv);
            bottom = new Vector3(bone[i].x * sinA, bone[i].y, W - oz + bone[i].x * adv);
            topface.push(top);
            bottomface.push(bottom);
        }

        let topvec = topface.concat(topface[0].clone());
        let bottomvec = bottomface.concat(bottomface[0].clone());

        if (!BIM.simpleMold) {
            // 侧边
            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, fone, holes, kongtype,
                (a: number, b: number) => [a * sinA, b, W - data.ZYKH + a * adv])
        }

        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, fone, holes, kongtype,
            (a: number, b: number) => [a * sinA, b, W - oz + a * adv]);

        // 如果是拉片体系    
        if (islptx && BIM.simpleMold) {
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                bottomface[0],
                new Vector3(bottomface[0].x, bottomface[0].y, bottomface[0].z + oz),
                new Vector3(bottomface[1].x, bottomface[1].y, bottomface[1].z + oz),
                bottomface[1]
            ], [
                new Vector2(bottomface[0].x, bottomface[0].z),
                new Vector2(bottomface[0].x, bottomface[0].z + oz),
                new Vector2(bottomface[1].x, bottomface[1].z + oz),
                new Vector2(bottomface[1].x, bottomface[1].z)
            ], null, null, (x, y) => [x, bottomface[0].y, y])


            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                bottomface[3],
                new Vector3(bottomface[3].x, bottomface[3].y, bottomface[3].z + oz),
                new Vector3(bottomface[2].x, bottomface[2].y, bottomface[2].z + oz),
                bottomface[2]
            ], [
                new Vector2(bottomface[3].x, bottomface[3].z),
                new Vector2(bottomface[3].x, bottomface[3].z + oz),
                new Vector2(bottomface[2].x, bottomface[2].z + oz),
                new Vector2(bottomface[2].x, bottomface[2].z)
            ], null, null, (x, y) => [x, bottomface[2].y, y])
        }

        return count;
    }

    static getRightSlotFengVI(count: number, vertices: number[], indices: number[], facevec: any[], fone: Vector2[], bone: Vector2[], holes: Path[],
        H: number, cosA: number, sinA: number, data: ALParams, kongtype: string, islptx: boolean = false, ox: number = 0): number {
        let topface: Vector3[] = [];
        let bottomface: Vector3[] = [];
        let top: Vector3, bottom: Vector3;
        let adv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
        let ra = data.p_yksctype === XQType.normal ? 1 : sinA;
        for (let i = 0; i < fone.length; i++) {

            top = new Vector3(H - ox + fone[i].y * adv, fone[i].x, fone[i].y * ra);
            bottom = new Vector3(H - data.ZYKH + bone[i].y * adv, bone[i].x, bone[i].y * ra);

            topface.push(top);
            bottomface.push(bottom);
        }

        let topvec = topface.concat();
        let bottomvec = bottomface.concat();
        if (!BIM.simpleMold) {
            // 侧边
            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        // 前后面
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, fone, holes, kongtype,
            (a: number, b: number) => [H - ox + b * adv, a, b * ra]);

        if (!BIM.simpleMold) {

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, bone, holes, kongtype,
                (a: number, b: number) => [H - data.ZYKH + b * adv, a, b * ra]);
        }

        // 如果是拉片体系    
        if (islptx && BIM.simpleMold) {
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                topface[0],
                new Vector3(topface[0].x + ox, topface[0].y, topface[0].z),
                new Vector3(topface[1].x + ox, topface[1].y, topface[1].z),
                topface[1]
            ], [
                new Vector2(topface[0].x, topface[0].z),
                new Vector2(topface[0].x + ox, topface[0].z),
                new Vector2(topface[1].x + ox, topface[1].z),
                new Vector2(topface[1].x, topface[1].z)
            ], null, null, (x, y) => [x, topface[0].y, y])


            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                topface[3],
                new Vector3(topface[3].x + ox, topface[3].y, topface[3].z),
                new Vector3(topface[2].x + ox, topface[2].y, topface[2].z),
                topface[2]
            ], [
                new Vector2(topface[3].x, topface[3].z),
                new Vector2(topface[3].x + ox, topface[3].z),
                new Vector2(topface[2].x + ox, topface[2].z),
                new Vector2(topface[2].x, topface[2].z)
            ], null, null, (x, y) => [x, topface[2].y, y])
        }

        return count;
    }

    /**
    * 获取普通c槽的内外斜切y值
    * @param tanA 
    * @param W 
    * @param H 
    * @param XQNXJL 
    * @param BKH 
    * @param zktype 
    * @param yktype 
    * @param type 
    * @returns 
    */
    static getIOXie(tanA: number, sinA: number, W: number, H: number, XQNXJL: number, BKH: number, GMT: number, BKT: number, zktype: number, yktype: number, type: number, top: boolean) {

        let one: number, two: number, three: number, four: number, five: number, six: number;
        let none: number, ntwo: number, nthree: number, nfour: number, nfive: number, nsix: number, nseven: number, neight: number;

        let gmtju = GMT / tanA;
        let xieju = BKH / tanA; //斜距
        let zbb = BKH / H;
        let ybb = BKH / W;

        let znbb = (H - xieju) / H;

        let zwbb = H / (H + xieju);

        let zbnn = (H - BKT / sinA - xieju) / H;
        let zbwn = H / (H - BKT / sinA + xieju);

        let ybnn = (W - BKT / sinA - xieju) / W;
        let ybwn = W / (W - BKT / sinA + xieju);

        let gmtn = (H - gmtju) / H;
        let gmtw = H / (H + gmtju);

        let wgmtn = (W - gmtju) / W;
        let wgmtw = W / (W + gmtju);

        let ynbb = (W - xieju) / W;
        let ywbb = W / (W + xieju);

        let zib = GMT / H;
        let zmb = (H - BKT) / H;

        let yib = GMT / W
        let ymb = (W - BKT) / W;

        if (type === XQType.czwx) {
            // 左外
            one = 0;
            two = 0;
            three = XQNXJL * zbb;
            four = XQNXJL * zbb;

            five = yktype === XQType.nx ? XQNXJL * znbb : yktype === XQType.wx ? XQNXJL / zwbb : XQNXJL;
            six = XQNXJL;

            none = XQNXJL * zib;
            ntwo = XQNXJL * zib;

            nthree = 0;
            nfour = XQNXJL * zbb;

            nfive = yktype === XQType.nx ? XQNXJL * zbnn : yktype === XQType.wx ? XQNXJL / zbwn : XQNXJL * zmb;
            nsix = XQNXJL * zmb;

            nseven = 0;
            neight = yktype === XQType.nx ? XQNXJL * gmtn : yktype === XQType.wx ? XQNXJL / gmtw : XQNXJL;;
        }
        else if (type === XQType.cznx) {
            // 左内
            one = 0;
            two = 0;
            three = -XQNXJL * zbb;
            four = -XQNXJL * zbb;

            five = yktype === XQType.nx ? -XQNXJL * znbb : yktype === XQType.wx ? -XQNXJL / zwbb : -XQNXJL;
            six = -XQNXJL;

            none = -XQNXJL * zib;
            ntwo = -XQNXJL * zib;
            nthree = 0;
            nfour = -XQNXJL * zbb;

            nfive = yktype === XQType.nx ? -XQNXJL * zbnn : yktype === XQType.wx ? - XQNXJL / zbwn : -XQNXJL * zmb;
            nsix = -XQNXJL * zmb;

            nseven = 0;
            neight = yktype === XQType.nx ? -XQNXJL * gmtn : yktype === XQType.wx ? -XQNXJL / gmtw : -XQNXJL;;
        }
        else if (type === XQType.spwx) {
            // 右外
            one = 0;
            two = XQNXJL
            three = zktype === XQType.nx ? XQNXJL * ynbb : zktype === XQType.wx ? XQNXJL / ywbb : XQNXJL;
            four = XQNXJL * ybb;

            five = XQNXJL * ybb;
            six = 0;


            none = 0;
            ntwo = zktype === XQType.nx ? XQNXJL * wgmtn : zktype === XQType.wx ? XQNXJL / wgmtw : XQNXJL;

            nthree = XQNXJL * ymb;
            nfour = zktype === XQType.nx ? XQNXJL * ybnn : zktype === XQType.wx ? XQNXJL / ybwn : XQNXJL * ymb;

            nfive = XQNXJL * ybb;
            nsix = 0;

            nseven = XQNXJL * yib;
            neight = XQNXJL * yib;
        }
        else if (type === XQType.spnx) {
            // 右内
            one = 0;
            two = -XQNXJL
            three = zktype === XQType.nx ? -XQNXJL * ynbb : zktype === XQType.wx ? -XQNXJL / ywbb : -XQNXJL;
            four = -XQNXJL * ybb;

            five = -XQNXJL * ybb;
            six = 0;

            none = 0;
            ntwo = zktype === XQType.nx ? -XQNXJL * wgmtn : zktype === XQType.wx ? -XQNXJL / wgmtw : -XQNXJL;

            nthree = -XQNXJL * ymb;
            nfour = zktype === XQType.nx ? -XQNXJL * ybnn : zktype === XQType.wx ? -XQNXJL / ybwn : - XQNXJL * ymb;

            nfive = -XQNXJL * ybb;
            nsix = 0;

            nseven = -XQNXJL * yib;
            neight = -XQNXJL * yib;
        }
        else {
            one = 0;
            two = 0;
            three = 0;
            four = 0;
            five = 0;
            six = 0;

            none = 0;
            ntwo = 0;
            nthree = 0;
            nfour = 0;

            nfive = 0;
            nsix = 0;
            nseven = 0;
            neight = 0;
        }
        return top ? [one, two, three, four, five, six, none, ntwo, nthree, nfour, nfive, nsix, nseven, neight] :
            [-one, -two, -three, -four, -five, -six, -none, -ntwo, -nthree, -nfour, -nfive, -nsix, -nseven, -neight];
    }

    /**
   * 普通/墙角 C 槽
   * @param iswall 
   * @param data 
   * @returns 
   */
    static getSlotVI(iswall: boolean, data: ALParams, H: number = +data.H): any[] {

        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let radian = data.XBNXJD / 180 * Math.PI;
        let cosA = Math.cos(radian);
        let sinA = Math.sin(radian);
        let tanA = Math.tan(radian);

        let path: Vector2[];
        let holes: Path[];
        let holePath: Path;

        // let H = Number(data.H);
        let W = Number(data.W);
        let L = Number(data.L);

        let DJXQW = Number(data.DJXQW);
        let DJXQH = Number(data.DJXQH);

        let fbsj = Number(data.fbsj);
        let kkzj = Number(data.kkzj);
        let p_kbj = Number(data.p_kbj);

        if (W === 50 || H === 50) {
            data.p_syxqtype = XQType.none;
            data.p_xzxqtype = XQType.none;
        }

        let drzykh = BIM.simpleMold ? 0 : data.ZYKH;
        data.blslot = W == 50 ? [
            drzykh, 0, data.BKH + W,
            drzykh, 0, data.BKH,
            H, 0, data.BKH
        ] : H == 50 ? [
            data.BKH, 0, W,
            data.BKH, 0, drzykh,
            data.BKH + H, 0, drzykh
        ] : [
            data.BKH, 0, W,
            data.BKH, 0, data.BKH,
            H, 0, data.BKH
        ];

        // important: 端点的前3个为顶面点，不要动给背楞用的。
        data.duan = [
            0, L, W,
            0, L, 0,
            H, L, 0,

            0, 0, 0,
            H, 0, 0,
            0, 0, W
        ];

        // 下/左封板” “上/右封板” 设置了“缩进”则按照常规的封边边框生成向内缩进（fbsj对应的参数值），
        // 对应那边的距边50和100的移动点不需要，只保留缩进平面的三个（fbsj对应的参数值）移动吸附点。
        if (!iswall) {

            if (data.p_xzfentype === XQType.sj) {
                data.duan.push(
                    0, fbsj, W,
                    0, fbsj, 0,
                    H, fbsj, 0,
                )
            }
            else {
                data.duan.push(
                    0, 50, W,
                    0, 50, 0,
                    H, 50, 0,
                    0, 100, 0
                )
            }
            if (data.p_syfentype === XQType.sj) {
                data.duan.push(
                    0, L - fbsj, W,
                    0, L - fbsj, 0,
                    H, L - fbsj, 0,
                )
            }
            else {
                data.duan.push(
                    0, L - 50, W,
                    0, L - 50, 0,
                    H, L - 50, 0,
                    0, L - 100, 0
                )
            }
        }
        else {
            data.duan.push(
                H, DJXQH, 0,
                0, DJXQH, W
            )
        }

        // 中点
        data.zhong = {
            L: [
                {
                    pointer: [H / 2, L, 0],
                    center: [H / 2, L / 2, 0],
                    dir: [0, L, 0]
                },
                {
                    pointer: [0, L, W / 2],
                    center: [0, L / 2, W / 2],
                    dir: [0, L, 0]
                }
            ],
            RL: [
                {
                    pointer: [H / 2, 0, 0],
                    center: [H / 2, L / 2, 0],
                    dir: [0, 0, 0]
                },
                {
                    pointer: [0, 0, W / 2],
                    center: [0, L / 2, W / 2],
                    dir: [0, L, 0]
                }
            ],

            W: [
                {
                    pointer: [0, L / 2, W],
                    center: [0, L / 2, W / 2],
                    dir: [0, L, W]
                }
            ],

            H: [
                {
                    pointer: [H, L / 2, 0],
                    center: [H / 2, L / 2, 0],
                    dir: [H, L, 0]
                }
            ]
        }

        // 边框孔中心点
        data.kongpoint = [];
        let kongpoint = [];
        let kx: number, ky: number, kz: number;

        // 缺口
        let QKH: number = Number(data.p_qkh);
        let QKW: number = Number(data.p_qkw);

        let p_lpch: number = Number(data.p_lpch);
        let p_lpck: number = Number(data.p_lpck);

        let top: Vector3, bottom: Vector3, topface: Vector3[], bottomface: Vector3[];
        let xv: number, yv: number, i: number;
        let backPath: Vector2[], frontPath: Vector2[];

        let len: number = data.BKH;

        let xzioxie = SlotUtils.getIOXie(tanA, sinA, W, H, data.XQNXJL, data.BKH, data.GMT, data.ZYKH, data.p_zksctype, data.p_yksctype, data.p_xzxqtype, false);
        let syioxie = SlotUtils.getIOXie(tanA, sinA, W, H, data.XQNXJL, data.BKH, data.GMT, data.ZYKH, data.p_zksctype, data.p_yksctype, data.p_syxqtype, true);

        let islptx: boolean = true;//Number(data.system_type) === 1;

        data.gmholes = [];

        data.lpcdw = [];

        let p_zklpcdw = AModelFmulaUtils.getHolesbyExpress(data.p_zklpcdw, L, 2, data, AK.p_zklpcdw);
        let p_yklpcdw = AModelFmulaUtils.getHolesbyExpress(data.p_yklpcdw, L, 2, data, AK.p_yklpcdw);

        //左面孔
        if (W === 50 && H != 50) {
            // 不生成左面孔
        }
        else {

            len = data.p_zksctype === XQType.nx ? -data.GMT / tanA : data.p_zksctype === XQType.wx ? data.GMT / tanA : 0;

            // 左缺口
            let leftpathv = SlotUtils.getLeftSlotGapPath(data, xzioxie, syioxie, L, W, len, islptx, p_zklpcdw);

            if (CommonUtils.haveData(leftpathv) && QKH < W) {
                backPath = leftpathv[0];
                frontPath = leftpathv[1];

            }
            else {
                backPath = [
                    new Vector2(0 + xzioxie[0], 0),
                    new Vector2(L + syioxie[0], 0),
                    new Vector2(L + syioxie[1], W),
                    new Vector2(0 + xzioxie[1], W)
                ];

                frontPath = [
                    new Vector2(0 + xzioxie[6], 0),
                    new Vector2(L + syioxie[6], 0),
                    new Vector2(L + syioxie[7], W + len),
                    new Vector2(0 + xzioxie[7], W + len)
                ];

            }

            if (!iswall) {

                let zspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zspkfa], W, 2, null, null, 10008);

                let zgmkw: string = "";
                if (data.p_xzfentype === XQType.sj) {
                    for (i = 0; i < zspkfa.length; i++) {

                        xv = p_kbj;
                        yv = zspkfa[i];

                        zgmkw += "(" + yv + "," + xv + ")";
                    }
                }

                if (data.p_syfentype === XQType.sj) {
                    for (i = 0; i < zspkfa.length; i++) {
                        xv = L - p_kbj;
                        yv = zspkfa[i];

                        zgmkw += "(" + yv + "," + xv + ")";
                    }
                }

                if (zgmkw !== "") {
                    data.p_l_r3 = kkzj.toString();
                    data.p_l_r3dw = zgmkw;
                }
            }

            data.p_l_r1 = CommonUtils.checkRadiusIsLegal(data.p_l_r1);
            data.p_l_r2 = CommonUtils.checkRadiusIsLegal(data.p_l_r2);
            data.p_l_r3 = CommonUtils.checkRadiusIsLegal(data.p_l_r3);

            data.p_l_r1dw = CommonUtils.fliterOuterPoint(data.p_l_r1dw, backPath, true, false, false, true, data.p_l_r1.toString());
            data.p_l_r2dw = CommonUtils.fliterOuterPoint(data.p_l_r2dw, backPath, true, false, false, true, data.p_l_r2.toString());
            data.p_l_r3dw = CommonUtils.fliterOuterPoint(data.p_l_r3dw, backPath, true, false, false, true, data.p_l_r3.toString());

            holes = [];
            CommonUtils.getGmtHoles(data.p_l_r1, data.p_l_r1dw, holes, 1);
            CommonUtils.getGmtHoles(data.p_l_r2, data.p_l_r2dw, holes, 1);
            CommonUtils.getGmtHoles(data.p_l_r3, data.p_l_r3dw, holes, 1);

            CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 0)

            data.gmholes.push(CommonUtils.getHolesData(data.p_l_r1, data.p_l_r1dw, 1, ConstDef.xnormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_l_r2, data.p_l_r2dw, 1, ConstDef.xnormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_l_r3, data.p_l_r3dw, 1, ConstDef.xnormal.clone()));

            count = CommonUtils.getFaceByPaths(count, vertices, indices, facevec, frontPath, backPath, holes, 1, 0, data.GMT, false, "p_l_r1dw", true);
        }

        // 右面孔
        if (H === 50 && W != 50) {
            // 不生成右面孔
        }
        else {

            len = data.p_yksctype === XQType.nx ? -data.GMT / tanA : data.p_yksctype === XQType.wx ? data.GMT / tanA : 0;

            // 左缺口
            let rightpathv = SlotUtils.getRightSlotGapPath(data, xzioxie, syioxie, L, H, len, islptx, p_yklpcdw);

            if (CommonUtils.haveData(rightpathv) && QKH < H) {
                frontPath = rightpathv[0];
                backPath = rightpathv[1];
            }
            else {
                backPath = [
                    new Vector2(0, 0 + xzioxie[0]),
                    new Vector2(H, 0 + xzioxie[5]),
                    new Vector2(H, L + syioxie[5]),
                    new Vector2(0, L + syioxie[0])
                ];

                frontPath = [
                    new Vector2(0, 0 + xzioxie[12]),
                    new Vector2(H + len, 0 + xzioxie[13]),
                    new Vector2(H + len, L + syioxie[13]),
                    new Vector2(0, L + syioxie[12])
                ];

            }

            // 普通C槽 
            if (!iswall) {
                let yspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_yspkfa], H, 2, null, null, 10008);

                let ygmkw: string = "";
                if (data.p_xzfentype === XQType.sj) {
                    for (i = 0; i < yspkfa.length; i++) {
                        xv = yspkfa[i];
                        yv = p_kbj;
                        ygmkw += "(" + xv + "," + yv + ")";
                    }
                }

                if (data.p_syfentype === XQType.sj) {
                    for (i = 0; i < yspkfa.length; i++) {
                        xv = yspkfa[i];
                        yv = L - p_kbj;
                        ygmkw += "(" + xv + "," + yv + ")";
                    }
                }

                if (ygmkw !== "") {
                    data.p_r_r3 = kkzj.toString();
                    data.p_r_r3dw = ygmkw;
                }
            }

            data.p_r_r1 = CommonUtils.checkRadiusIsLegal(data.p_r_r1);
            data.p_r_r2 = CommonUtils.checkRadiusIsLegal(data.p_r_r2);
            data.p_r_r3 = CommonUtils.checkRadiusIsLegal(data.p_r_r3);

            data.p_r_r1dw = CommonUtils.fliterOuterPoint(data.p_r_r1dw, backPath, false, false, false, true, data.p_r_r1.toString());
            data.p_r_r2dw = CommonUtils.fliterOuterPoint(data.p_r_r2dw, backPath, false, false, false, true, data.p_r_r2.toString());
            data.p_r_r3dw = CommonUtils.fliterOuterPoint(data.p_r_r3dw, backPath, false, false, false, true, data.p_r_r3.toString());

            holes = [];
            CommonUtils.getGmtHoles(data.p_r_r1, data.p_r_r1dw, holes, 0);
            CommonUtils.getGmtHoles(data.p_r_r2, data.p_r_r2dw, holes, 0);
            CommonUtils.getGmtHoles(data.p_r_r3, data.p_r_r3dw, holes, 0);

            CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 2)

            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r1, data.p_r_r1dw, 0, ConstDef.znormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r2, data.p_r_r2dw, 0, ConstDef.znormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r3, data.p_r_r3dw, 0, ConstDef.znormal.clone()));

            count = CommonUtils.getFaceByPaths(count, vertices, indices, facevec, frontPath, backPath, holes, 0, 0, data.GMT, false, "p_r_r1dw", true);
        }

        // 左前
        let zqpos = AModelFmulaUtils.getHolesbyExpress(data.p_zkkw, L, 2, data, AK.p_zkkw);
        if (W === 50 && H != 50) {

            path = iswall ? [
                new Vector2(0, 0),
                new Vector2(0, W + DJXQW),
                new Vector2(DJXQH, W + data.BKH),
                new Vector2(L, W + data.BKH),
                new Vector2(L, 0)
            ] : [
                new Vector2(0, 0),
                new Vector2(0, W + data.BKH),
                new Vector2(L, W + data.BKH),
                new Vector2(L, 0)
            ];
            holes = [];
            kongpoint = [];
            for (i = 0; i < zqpos.length; i++) {
                xv = zqpos[i];
                yv = W + data.BKH - data.BKKJMDis;

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                holes.push(holePath);

                kongpoint.push(0, xv, yv);
            }

            data.kongpoint.push(...kongpoint);

            if (BIM.simpleMold) {

                let zqface = []
                for (i = 0; i < path.length; i++) {
                    zqface.push(new Vector3(0, path[i].x, path[i].y))
                }
                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, zqface, path, holes, AK.p_zkkw,
                    (a: number, b: number) => [0, a, b]);
            }
            else {
                count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, 0, data.ZYKH, false, AK.p_zkkw);
            }

        }
        else {

            len = data.p_zksctype === XQType.normal ? data.BKH : data.BKH / sinA;
            // 右缺口
            let zlpkw = []
            let leftpv = SlotUtils.getNormalSlotLeftGapPath(iswall, data, len, DJXQW, DJXQH, xzioxie, syioxie, islptx, zlpkw);
            let leftqkvec = [leftpv.front, leftpv.back, leftpv.frontlp, leftpv.backlp];

            if (CommonUtils.haveData(leftqkvec)) {

                if (QKH > 0 && QKW > 0 && QKH < W) {
                    for (i = 0; i < leftqkvec[0].length; i++) {

                        let fone = leftqkvec[0][i].concat();
                        let bone = leftqkvec[1][i].concat();

                        let minvecx = CommonUtils.getVectorMinX(fone, bone, true);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < zqpos.length; j++) {
                            xv = data.BKH - data.BKKJMDis;
                            yv = zqpos[j];

                            if (yv > minvecx[0] - data.BKDia / 2 || yv < minvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_zksctype === XQType.nx ? - cosA : data.p_zksctype === XQType.wx ? cosA : 0;
                            kx = b * sinA;
                            ky = c;
                            kz = W + b * kadv;

                            return [kx, ky, kz];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getLeftSlotFengVI(count, vertices, indices, facevec, fone, bone, holes, W, cosA, sinA, data, AK.p_zkkw);
                    }
                }

                if (islptx && leftqkvec[2].length > 0 && leftqkvec[3].length > 0) {
                    for (i = 0; i < leftqkvec[2].length; i++) {

                        let lpfone = leftqkvec[2][i].concat();
                        let lpbone = leftqkvec[3][i].concat();

                        let lpminvecx = CommonUtils.getVectorMinX(lpfone, lpbone, true);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < zqpos.length; j++) {
                            xv = data.BKH - data.BKKJMDis;
                            yv = zqpos[j];

                            if (yv > lpminvecx[0] - data.BKDia / 2 || yv < lpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_zksctype === XQType.nx ? - cosA : data.p_zksctype === XQType.wx ? cosA : 0;
                            kx = b * sinA;
                            ky = c;
                            kz = W + b * kadv - p_lpch;

                            return [kx, ky, kz];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getLeftSlotFengVI(count, vertices, indices, facevec, lpfone, lpbone, holes, W, cosA, sinA, data, AK.p_zklpcdw, islptx, p_lpch);


                        // 拉片槽位置
                        kongpoint = [];
                        for (let j = 0; j < zlpkw.length; j++) {
                            xv = data.BKH - data.BKKJMDis;
                            yv = zlpkw[j];

                            if (yv > lpminvecx[0] - data.BKDia / 2 || yv < lpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_zksctype === XQType.nx ? - cosA : data.p_zksctype === XQType.wx ? cosA : 0;
                            kx = b * sinA;
                            ky = c;
                            kz = W + b * kadv - p_lpch;

                            return [kx, ky, kz];
                        });

                        data.lpcdw.push({ key: AK.p_zklpcdw, dw: [...kongpoint], dir: [0, 0, 1] })
                    }
                }

            }
            else {
                if (iswall) {
                    frontPath = [
                        new Vector2(0, 0),
                        new Vector2(len - DJXQW, 0),
                        new Vector2(len, DJXQH),
                        new Vector2(len, L),
                        new Vector2(0, L)
                    ]

                    backPath = [
                        new Vector2(0, 0),
                        new Vector2(len - DJXQW, 0),
                        new Vector2(len, DJXQH),
                        new Vector2(len, L),
                        new Vector2(0, L)
                    ]

                }
                else {
                    frontPath = [
                        new Vector2(0, 0 + xzioxie[1]),
                        new Vector2(len, 0 + xzioxie[2]),
                        new Vector2(len, L + syioxie[2]),
                        new Vector2(0, L + syioxie[1])
                    ]
                    backPath = [
                        new Vector2(0, 0 + xzioxie[8]),
                        new Vector2(len, 0 + xzioxie[9]),
                        new Vector2(len, L + syioxie[9]),
                        new Vector2(0, L + syioxie[8])
                    ]
                }

                // 左框常规内外斜
                holes = [];
                kongpoint = [];
                for (i = 0; i < zqpos.length; i++) {
                    xv = data.BKH - data.BKKJMDis;
                    yv = zqpos[i];

                    if (data.p_xzxqtype === XQType.spnx) {
                        if (yv < data.XQNXJL + data.BKDia / 2) {
                            continue;
                        }
                    }
                    if (data.p_syxqtype === XQType.spnx) {

                        if (yv > L - data.XQNXJL - data.BKDia / 2) {
                            continue;
                        }
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                    holes.push(holePath);

                    kongpoint.push(0, xv, yv);
                }

                if (data.p_zksctype === XQType.normal) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                        kx = b;
                        ky = c;
                        kz = W;

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);
                    count = CommonUtils.getFaceByPaths(count, vertices, indices, facevec, backPath, frontPath, holes, 0, W, W - data.ZYKH, false, AK.p_zkkw, true);
                }
                else if (data.p_zksctype === XQType.nx) {
                    // 内斜
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        let kadv = -cosA;
                        kx = b * sinA;
                        ky = c;
                        kz = W + b * kadv;

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 0, 0, W - data.ZYKH, W, false, AK.p_zkkw, true)
                }
                else if (data.p_zksctype === XQType.wx) {
                    // 外斜
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        let kadv = cosA;
                        kx = b * sinA;
                        ky = c;
                        kz = W + b * kadv;

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 1, 0, W - data.ZYKH, W, false, AK.p_zkkw, true)
                }
            }
        }

        // 右侧
        let ycpos = AModelFmulaUtils.getHolesbyExpress(data.p_ykkw, L, 2, data, AK.p_ykkw);
        if (H === 50 && W != 50) {

            path = iswall ? [
                new Vector2(0, 0),
                new Vector2(H + DJXQW, 0),
                new Vector2(H + data.BKH, DJXQH),
                new Vector2(H + data.BKH, L),
                new Vector2(0, L)
            ] : [
                new Vector2(0, 0),
                new Vector2(H + data.BKH, 0),
                new Vector2(H + data.BKH, L),
                new Vector2(0, L)
            ]

            holes = [];
            kongpoint = [];
            for (i = 0; i < ycpos.length; i++) {
                xv = H + data.BKH - data.BKKJMDis;
                yv = ycpos[i];

                let holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(xv, yv, 0);
            }

            data.kongpoint.push(...kongpoint);

            if (BIM.simpleMold) {

                let yqface = []
                for (i = 0; i < path.length; i++) {
                    yqface.push(new Vector3(0, path[i].x, path[i].y))
                }
                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, yqface, path, holes, AK.p_ykkw,
                    (a: number, b: number) => [a, b, 0]);
            }
            else {
                count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 0, data.ZYKH, 0, true, AK.p_ykkw);
            }
        }
        else {

            len = data.p_yksctype === XQType.normal ? data.BKH : data.BKH / sinA;

            // 右缺口
            // 缺口值
            let ylpkw = []
            let rightpv = SlotUtils.getNormalSlotRightGapPath(iswall, data, len, DJXQW, DJXQH, xzioxie, syioxie, islptx, ylpkw);
            let rigthqkvec = [rightpv.front, rightpv.back, rightpv.frontlp, rightpv.backlp];
            if (CommonUtils.haveData(rigthqkvec)) {

                if (QKH > 0 && QKW > 0 && QKH < H) {
                    for (i = 0; i < rigthqkvec[0].length; i++) {

                        let fone = rigthqkvec[0][i].concat();
                        let bone = rigthqkvec[1][i].concat();

                        let minvecx = CommonUtils.getVectorMinX(fone, bone);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < ycpos.length; j++) {
                            xv = ycpos[j];
                            yv = data.BKH - data.BKKJMDis;

                            if (xv > minvecx[0] - data.BKDia / 2 || xv < minvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            kx = H + c * kadv;
                            ky = b;
                            kz = c * kra

                            return [kx, ky, kz];
                        });
                        data.kongpoint.push(...kongpoint);


                        count = SlotUtils.getRightSlotFengVI(count, vertices, indices, facevec, fone, bone, holes, H, cosA, sinA, data, AK.p_ykkw);

                    }
                }
                if (islptx && rigthqkvec[2].length > 0 && rigthqkvec[3].length > 0) {
                    for (i = 0; i < rigthqkvec[2].length; i++) {

                        let rlpfone = rigthqkvec[2][i].concat();
                        let rlpbone = rigthqkvec[3][i].concat();

                        let rlpminvecx = CommonUtils.getVectorMinX(rlpfone, rlpbone);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < ycpos.length; j++) {
                            xv = ycpos[j];
                            yv = data.BKH - data.BKKJMDis;

                            if (xv > rlpminvecx[0] - data.BKDia / 2 || xv < rlpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            kx = H + c * kadv - p_lpch;
                            ky = b;
                            kz = c * kra

                            return [kx, ky, kz];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getRightSlotFengVI(count, vertices, indices, facevec, rlpfone, rlpbone, holes, H, cosA, sinA, data, AK.p_ykkw, islptx, p_lpch);

                        // 拉片槽位置
                        kongpoint = [];
                        for (let j = 0; j < ylpkw.length; j++) {
                            xv = ylpkw[j];
                            yv = data.BKH - data.BKKJMDis;

                            if (xv > rlpminvecx[0] - data.BKDia / 2 || xv < rlpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            kx = H + c * kadv - p_lpch;
                            ky = b;
                            kz = c * kra

                            return [kx, ky, kz];
                        });
                        data.lpcdw.push({ key: AK.p_yklpcdw, dw: [...kongpoint], dir: [1, 0, 0] })
                    }
                }

            }
            else {
                if (iswall) {
                    frontPath = [
                        new Vector2(0, 0),
                        new Vector2(0, len - DJXQW),
                        new Vector2(DJXQH, len),
                        new Vector2(L, len),
                        new Vector2(L, 0)
                    ]

                    backPath = [
                        new Vector2(0, 0),
                        new Vector2(0, len - DJXQW),
                        new Vector2(DJXQH, len),
                        new Vector2(L, len),
                        new Vector2(L, 0)
                    ]
                }
                else {
                    frontPath = [
                        new Vector2(0 + xzioxie[5], 0),
                        new Vector2(0 + xzioxie[4], len),
                        new Vector2(L + syioxie[4], len),
                        new Vector2(L + syioxie[5], 0)
                    ]

                    backPath = [
                        new Vector2(0 + xzioxie[11], 0),
                        new Vector2(0 + xzioxie[10], len),
                        new Vector2(L + syioxie[10], len),
                        new Vector2(L + syioxie[11], 0)
                    ]
                }


                holes = [];
                kongpoint = [];
                for (i = 0; i < ycpos.length; i++) {
                    xv = ycpos[i];
                    yv = data.BKH - data.BKKJMDis;

                    if (data.p_xzxqtype === XQType.cznx) {
                        if (xv < data.XQNXJL + data.BKDia / 2) {
                            continue;
                        }
                    }
                    if (data.p_syxqtype === XQType.cznx) {

                        if (xv > L - data.XQNXJL - data.BKDia / 2) {
                            continue;
                        }
                    }

                    let holePath = new Path();
                    holePath.moveTo(xv, yv)
                        .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(0, xv, yv);
                }

                if (data.p_yksctype === XQType.normal) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                        kx = H;
                        ky = b;
                        kz = c;

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = CommonUtils.getFaceByPaths(count, vertices, indices, facevec, backPath, frontPath, holes, 1, H, H - data.ZYKH, false, AK.p_ykkw);
                }
                else if (data.p_yksctype === XQType.nx) {
                    // 内斜
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        let kadv = -cosA;

                        kx = H + c * kadv;
                        ky = b;
                        kz = c * sinA;

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 0, 1, H - data.ZYKH, H, false, AK.p_ykkw)
                }
                else if (data.p_yksctype === XQType.wx) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        let kadv = cosA;
                        kx = H + c * kadv;
                        ky = b;
                        kz = c * sinA;

                        return [kx, ky, kz];
                    });
                    // 外斜
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 1, 1, H - data.ZYKH, H, false, AK.p_ykkw)
                }
            }
        }



        // 顶/底封板
        holes = [];
        kongpoint = [];

        let zypk = AModelFmulaUtils.getHolesbyExpress(data.p_zypkk, W, 2, data, AK.p_zypkk);
        let yypk = AModelFmulaUtils.getHolesbyExpress(data.p_yypkk, H, 2, data, AK.p_yypkk);

        if (W != 50) {
            // 左平孔-宽
            for (i = 0; i < zypk.length; i++) {
                xv = data.BKH - data.BKKJMDis;
                yv = zypk[i];
                if (yv > W - data.BKDia / 2) {
                    continue;
                }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(xv, L, yv);

                if (!iswall) kongpoint.push(xv, 0, yv);
            }
        }

        if (H != 50) {
            // 右平孔-高
            for (i = 0; i < yypk.length; i++) {
                xv = yypk[i];
                yv = data.BKH - data.BKKJMDis;
                if (xv > H - data.BKDia / 2) {
                    continue;
                }
                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(xv, L, yv);
                if (!iswall) kongpoint.push(xv, 0, yv);
            }
        }

        if ((W == 100 && H == 100)) {

            holes = [];
            kongpoint = [];
            let tfone = new Vector2(data.BKH - data.BKKJMDis, zypk[0]);
            let tftwo = new Vector2(yypk[0], data.BKH - data.BKKJMDis);

            holePath = CommonUtils.getCapsulePath(tfone, tftwo, data.BKDia / 2, true);
            holes.push(holePath);

            kongpoint.push(zypk[0], L, yypk[0]);
            if (!iswall) kongpoint.push(zypk[0], 0, yypk[0]);

        }


        let lbv = data.p_zksctype === XQType.nx ? -data.BKH / tanA : data.p_zksctype === XQType.wx ? data.BKH / tanA : 0;
        let rbv = data.p_yksctype === XQType.nx ? -data.BKH / tanA : data.p_yksctype === XQType.wx ? data.BKH / tanA : 0;

        let HC = CommonUtils.SqrtValue(data.XQNXJL, H);
        let WC = CommonUtils.SqrtValue(data.XQNXJL, W);

        let sfface = [];
        let sinB: number, cosB: number;
        if (H === 50 && W != 50) {

            path = data.p_syfentype === XQType.mf ? [
                new Vector2(0, 0),
                new Vector2(0, W),
                new Vector2(H + data.BKH, W),
                new Vector2(H + data.BKH, 0)
            ] : [
                new Vector2(0, 0),
                new Vector2(0, W),
                new Vector2(data.BKH, W + lbv),
                new Vector2(data.BKH, 0)
            ]
            sfface = [];
            for (i = 0; i < path.length; i++) {
                sfface.push(new Vector3(path[i].x, L, path[i].y))
            }

            if (data.p_syfentype === XQType.normal) {

                if (BIM.simpleMold) {

                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                        (a: number, b: number) => [a, L, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L, L - data.SXKH, false, "p_fbk");
                }

                data.kongpoint.push(...kongpoint);
            }
            else if (data.p_syfentype === XQType.mf) {

                if (BIM.simpleMold) {
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                        (a: number, b: number) => [a, L, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, L, L - data.SXKH, false, null);
                }
            }
            else if (data.p_syfentype === XQType.sj) {
                if (BIM.simpleMold) {

                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                        (a: number, b: number) => [a, L - fbsj, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L - fbsj, L - data.SXKH - fbsj, false, "p_fbk");
                }

                data.kongpoint.push(...kongpoint);
            }

            if (!iswall) {
                path = data.p_xzfentype === XQType.mf ? [
                    new Vector2(0, 0),
                    new Vector2(0, W),
                    new Vector2(H + data.BKH, W),
                    new Vector2(H + data.BKH, 0)
                ] : [
                    new Vector2(0, 0),
                    new Vector2(0, W),
                    new Vector2(data.BKH, W + lbv),
                    new Vector2(data.BKH, 0)
                ]

                sfface = [];
                for (i = 0; i < path.length; i++) {
                    sfface.push(new Vector3(path[i].x, 0, path[i].y))
                }

                if (data.p_xzfentype === XQType.normal) {
                    if (BIM.simpleMold) {

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                            (a: number, b: number) => [a, 0, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, data.SXKH, 0, false, "p_fbk");
                    }

                    data.kongpoint.push(...kongpoint);
                }
                else if (data.p_xzfentype === XQType.mf) {
                    if (BIM.simpleMold) {

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                            (a: number, b: number) => [a, 0, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, data.SXKH, 0, false, null);
                    }
                }
                if (data.p_xzfentype === XQType.sj) {
                    if (BIM.simpleMold) {

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                            (a: number, b: number) => [a, fbsj, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, fbsj + data.SXKH, fbsj, false, "p_fbk");
                    }

                    data.kongpoint.push(...kongpoint);
                }
            }
        }
        else if (W === 50 && H != 50) {

            path = data.p_syfentype === XQType.mf ? [
                new Vector2(0, 0),
                new Vector2(0, W + data.BKH),
                new Vector2(H, W + data.BKH),
                new Vector2(H, 0)
            ] : [
                new Vector2(0, 0),
                new Vector2(0, data.BKH),
                new Vector2(H + rbv, data.BKH),
                new Vector2(H, 0)
            ]

            sfface = [];
            for (i = 0; i < path.length; i++) {
                sfface.push(new Vector3(path[i].x, L, path[i].y))
            }
            if (data.p_syfentype === XQType.normal) {
                if (BIM.simpleMold) {
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                        (a: number, b: number) => [a, L, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L, L - data.SXKH, false, "p_fbk");
                }
                data.kongpoint.push(...kongpoint);
            }
            else if (data.p_syfentype === XQType.mf) {
                if (BIM.simpleMold) {
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                        (a: number, b: number) => [a, L, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, L, L - data.SXKH, false, null);
                }

            }
            if (data.p_syfentype === XQType.sj) {
                if (BIM.simpleMold) {
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                        (a: number, b: number) => [a, L - fbsj, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L - fbsj, L - data.SXKH - fbsj, false, "p_fbk");
                }
                data.kongpoint.push(...kongpoint);
            }

            if (!iswall) {
                path = data.p_xzfentype === XQType.mf ? [
                    new Vector2(0, 0),
                    new Vector2(0, W + data.BKH),
                    new Vector2(H, W + data.BKH),
                    new Vector2(H, 0)
                ] : [
                    new Vector2(0, 0),
                    new Vector2(0, data.BKH),
                    new Vector2(H + rbv, data.BKH),
                    new Vector2(H, 0)
                ]

                sfface = [];
                for (i = 0; i < path.length; i++) {
                    sfface.push(new Vector3(path[i].x, 0, path[i].y))
                }

                if (data.p_xzfentype === XQType.normal) {
                    if (BIM.simpleMold) {

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                            (a: number, b: number) => [a, 0, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, data.SXKH, 0, false, "p_fbk");
                    }

                    data.kongpoint.push(...kongpoint);
                }
                else if (data.p_xzfentype === XQType.mf) {
                    if (BIM.simpleMold) {

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                            (a: number, b: number) => [a, 0, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, data.SXKH, 0, false, null);
                    }

                }
                if (data.p_xzfentype === XQType.sj) {
                    if (BIM.simpleMold) {

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, holes, "p_fbk",
                            (a: number, b: number) => [a, fbsj, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, fbsj + data.SXKH, fbsj, false, "p_fbk");
                    }

                    data.kongpoint.push(...kongpoint);
                }
            }
        }
        else {

            let syholes = data.p_syfentype === XQType.mf ? null : holes;
            if (data.p_syfentype === XQType.none) {

            }
            else if (data.p_syfentype === XQType.sj) {
                path = [
                    new Vector2(0, 0),
                    new Vector2(0, W),
                    new Vector2(data.BKH, W + lbv),
                    new Vector2(data.BKH, data.BKH),
                    new Vector2((H + rbv), data.BKH),
                    new Vector2(H, 0)
                ]
                sfface = [];
                for (i = 0; i < path.length; i++) {
                    sfface.push(new Vector3(path[i].x, L - fbsj, path[i].y))
                }

                if (BIM.simpleMold) {
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, syholes, "p_fbk",
                        (a: number, b: number) => [a, L - fbsj, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L - fbsj, L - data.SXKH - fbsj, false, "p_fbk");
                }

                data.kongpoint.push(...kongpoint);
            }
            else {

                if (data.p_syxqtype === XQType.czwx) {
                    cosB = H / HC;
                    sinB = data.XQNXJL / HC;
                    path = data.p_syfentype === XQType.mf ? [
                        new Vector2(0, 0),
                        new Vector2(0, W),
                        new Vector2(H / cosB, W),
                        new Vector2(H / cosB, 0)
                    ] : [
                        new Vector2(0, 0),
                        new Vector2(0, W),
                        new Vector2(data.BKH / cosB, W + lbv),
                        new Vector2(data.BKH / cosB, data.BKH),
                        new Vector2((H + rbv) / cosB, data.BKH),
                        new Vector2(H / cosB, 0)
                    ]

                    topface = [];
                    bottomface = [];
                    for (i = 0; i < path.length; i++) {

                        top = new Vector3(path[i].x * cosB, L + path[i].x * sinB, path[i].y);

                        bottom = new Vector3(path[i].x * cosB, L - data.SXKH + path[i].x * sinB, path[i].y);

                        topface.push(top);
                        bottomface.push(bottom);
                    }

                    let topvec = topface.concat(topface[0].clone());
                    let bottomvec = bottomface.concat(bottomface[0].clone());

                    if (!BIM.simpleMold) {
                        // 侧边
                        let side = CommonUtils.getSideVIF(bottomvec, topvec, count);
                        vertices.push(...side[0]);
                        indices.push(...side[1]);
                        facevec.push(...side[2]);
                        count = side[3];

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, syholes, "p_fbk",
                            (a: number, b: number) => [a * cosB, L - data.SXKH + a * sinB, b])
                    }


                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, syholes, "p_fbk",
                        (a: number, b: number) => [a * cosB, L + a * sinB, b])


                    CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                        kx = a * cosB;
                        ky = L + a * sinB;
                        kz = b;

                        return [kx, ky, kz];
                    })

                }
                else if (data.p_syxqtype === XQType.cznx) {
                    cosB = H / HC;
                    sinB = data.XQNXJL / HC;
                    path = data.p_syfentype === XQType.mf ? [
                        new Vector2(0, 0),
                        new Vector2(0, W),
                        new Vector2(H / cosB, W),
                        new Vector2(H / cosB, 0)
                    ] : [
                        new Vector2(0, 0),
                        new Vector2(0, W),
                        new Vector2(data.BKH / cosB, W + lbv),
                        new Vector2(data.BKH / cosB, data.BKH),
                        new Vector2((H + rbv) / cosB, data.BKH),
                        new Vector2(H / cosB, 0)
                    ]
                    topface = [];
                    bottomface = [];
                    for (i = 0; i < path.length; i++) {

                        top = new Vector3(path[i].x * cosB, L - path[i].x * sinB, path[i].y);

                        bottom = new Vector3(path[i].x * cosB, L - data.SXKH - path[i].x * sinB, path[i].y);

                        topface.push(top);
                        bottomface.push(bottom);
                    }

                    let topvec = topface.concat(topface[0].clone());
                    let bottomvec = bottomface.concat(bottomface[0].clone());
                    if (!BIM.simpleMold) {
                        // 侧边
                        let side = CommonUtils.getSideVIF(bottomvec, topvec, count);
                        vertices.push(...side[0]);
                        indices.push(...side[1]);
                        facevec.push(...side[2]);
                        count = side[3];

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, syholes, "p_fbk",
                            (a: number, b: number) => [a * cosB, L - data.SXKH - a * sinB, b])
                    }

                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, syholes, "p_fbk",
                        (a: number, b: number) => [a * cosB, L - a * sinB, b])


                    CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                        kx = a * cosB;
                        ky = L - a * sinB;
                        kz = b;

                        return [kx, ky, kz];


                    })
                }
                else if (data.p_syxqtype === XQType.spwx) {
                    cosB = W / WC;
                    sinB = data.XQNXJL / WC;
                    path = data.p_syfentype === XQType.mf ? [
                        new Vector2(0, 0),
                        new Vector2(0, W / cosB),
                        new Vector2(H, W / cosB),
                        new Vector2(H, 0)
                    ] : [
                        new Vector2(0, 0),
                        new Vector2(0, W / cosB),
                        new Vector2(data.BKH, (W + lbv) / cosB),
                        new Vector2(data.BKH, data.BKH / cosB),
                        new Vector2((H + rbv), data.BKH / cosB),
                        new Vector2(H, 0)
                    ];


                    topface = [];
                    bottomface = [];
                    for (i = 0; i < path.length; i++) {

                        top = new Vector3(path[i].x, L + path[i].y * sinB, path[i].y * cosB);

                        bottom = new Vector3(path[i].x, L - data.SXKH + path[i].y * sinB, path[i].y * cosB);

                        topface.push(top);
                        bottomface.push(bottom);
                    }

                    let topvec = topface.concat(topface[0].clone());
                    let bottomvec = bottomface.concat(bottomface[0].clone());
                    if (!BIM.simpleMold) {
                        // 侧边
                        let side = CommonUtils.getSideVIF(bottomvec, topvec, count);
                        vertices.push(...side[0]);
                        indices.push(...side[1]);
                        facevec.push(...side[2]);
                        count = side[3];

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, syholes, "p_fbk",
                            (a: number, b: number) => [a, L - data.SXKH + b * sinB, b * cosB])
                    }

                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, syholes, "p_fbk",
                        (a: number, b: number) => [a, L + b * sinB, b * cosB])


                    CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                        kx = a;
                        ky = L + b * sinB;
                        kz = b * cosB;

                        return [kx, ky, kz];


                    })



                }
                else if (data.p_syxqtype === XQType.spnx) {
                    cosB = W / WC;
                    sinB = data.XQNXJL / WC;
                    path = data.p_syfentype === XQType.mf ? [
                        new Vector2(0, 0),
                        new Vector2(0, W / cosB),
                        new Vector2(H, W / cosB),
                        new Vector2(H, 0)
                    ] : [
                        new Vector2(0, 0),
                        new Vector2(0, W / cosB),
                        new Vector2(data.BKH, (W + lbv) / cosB),
                        new Vector2(data.BKH, data.BKH / cosB),
                        new Vector2((H + rbv), data.BKH / cosB),
                        new Vector2(H, 0)
                    ]

                    topface = [];
                    bottomface = [];
                    for (i = 0; i < path.length; i++) {

                        top = new Vector3(path[i].x, L - path[i].y * sinB, path[i].y * cosB);
                        bottom = new Vector3(path[i].x, L - data.SXKH - path[i].y * sinB, path[i].y * cosB);

                        topface.push(top);
                        bottomface.push(bottom);
                    }


                    let topvec = topface.concat(topface[0].clone());
                    let bottomvec = bottomface.concat(bottomface[0].clone());
                    if (!BIM.simpleMold) {
                        // 侧边
                        let side = CommonUtils.getSideVIF(bottomvec, topvec, count);
                        vertices.push(...side[0]);
                        indices.push(...side[1]);
                        facevec.push(...side[2]);
                        count = side[3];

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, syholes, "p_fbk",
                            (a: number, b: number) => [a, L - data.SXKH - b * sinB, b * cosB])
                    }

                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, syholes, "p_fbk",
                        (a: number, b: number) => [a, L - b * sinB, b * cosB])


                    CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                        kx = a;
                        ky = L - b * sinB;
                        kz = b * cosB;

                        return [kx, ky, kz];


                    })


                }
                else {
                    if (data.p_syfentype === XQType.mf) {
                        path = [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(H, W),
                            new Vector2(H, 0)
                        ]
                        sfface = [];
                        for (i = 0; i < path.length; i++) {
                            sfface.push(new Vector3(path[i].x, L, path[i].y))
                        }
                        if (BIM.simpleMold) {
                            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                                (a: number, b: number) => [a, L, b]);
                        }
                        else {
                            count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, L, L - data.SXKH, false, null);
                        }

                    }
                    else {
                        path = [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(data.BKH, W + lbv),
                            new Vector2(data.BKH, data.BKH),
                            new Vector2((H + rbv), data.BKH),
                            new Vector2(H, 0)
                        ]
                        sfface = [];
                        for (i = 0; i < path.length; i++) {
                            sfface.push(new Vector3(path[i].x, L, path[i].y))
                        }

                        if (BIM.simpleMold) {
                            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, syholes, "p_fbk",
                                (a: number, b: number) => [a, L, b]);
                        }
                        else {
                            count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L, L - data.SXKH, false, "p_fbk");
                        }

                        data.kongpoint.push(...kongpoint);
                    }

                }
            }

            if (!iswall) {

                let xzholes = data.p_xzfentype === XQType.mf ? null : holes;

                if (data.p_xzfentype === XQType.none) {

                }
                else if (data.p_xzfentype === XQType.sj) {
                    path = [
                        new Vector2(0, 0),
                        new Vector2(0, W),
                        new Vector2(data.BKH, W + lbv),
                        new Vector2(data.BKH, data.BKH),
                        new Vector2((H + rbv), data.BKH),
                        new Vector2(H, 0)
                    ]
                    sfface = [];
                    for (i = 0; i < path.length; i++) {
                        sfface.push(new Vector3(path[i].x, fbsj, path[i].y))
                    }
                    if (BIM.simpleMold) {
                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, xzholes, "p_fbk",
                            (a: number, b: number) => [a, fbsj, b]);
                    }
                    else {
                        count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, xzholes, 2, fbsj + data.SXKH, fbsj, false, "p_fbk");
                    }

                    data.kongpoint.push(...kongpoint);
                }
                else {
                    // 下封
                    if (data.p_xzxqtype === XQType.czwx) {
                        cosB = H / HC;
                        sinB = data.XQNXJL / HC;
                        path = data.p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(H / cosB, W),
                            new Vector2(H / cosB, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(data.BKH / cosB, W + lbv),
                            new Vector2(data.BKH / cosB, data.BKH),
                            new Vector2((H + rbv) / cosB, data.BKH),
                            new Vector2(H / cosB, 0)
                        ]

                        topface = [];
                        bottomface = [];
                        for (i = 0; i < path.length; i++) {

                            top = new Vector3(path[i].x * cosB, -path[i].x * sinB, path[i].y);

                            bottom = new Vector3(path[i].x * cosB, data.SXKH - path[i].x * sinB, path[i].y);

                            topface.push(top);
                            bottomface.push(bottom);
                        }

                        let topvec = topface.concat(topface[0].clone());
                        let bottomvec = bottomface.concat(bottomface[0].clone());

                        if (!BIM.simpleMold) {
                            // 侧边
                            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
                            vertices.push(...side[0]);
                            indices.push(...side[1]);
                            facevec.push(...side[2]);
                            count = side[3];

                            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, xzholes, "p_fbk",
                                (a: number, b: number) => [a * cosB, data.SXKH - a * sinB, b])
                        }

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, xzholes, "p_fbk",
                            (a: number, b: number) => [a * cosB, - a * sinB, b])


                        CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                            kx = a * cosB;
                            ky = - a * sinB;
                            kz = b;


                            return [kx, ky, kz];


                        })



                    }
                    else if (data.p_xzxqtype === XQType.cznx) {
                        cosB = H / HC;
                        sinB = data.XQNXJL / HC;
                        path = path = data.p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(H / cosB, W),
                            new Vector2(H / cosB, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(data.BKH / cosB, W + lbv),
                            new Vector2(data.BKH / cosB, data.BKH),
                            new Vector2((H + rbv) / cosB, data.BKH),
                            new Vector2(H / cosB, 0)
                        ]
                        topface = [];
                        bottomface = [];
                        for (i = 0; i < path.length; i++) {

                            top = new Vector3(path[i].x * cosB, path[i].x * sinB, path[i].y);

                            bottom = new Vector3(path[i].x * cosB, data.SXKH + path[i].x * sinB, path[i].y);

                            topface.push(top);
                            bottomface.push(bottom);
                        }

                        let topvec = topface.concat(topface[0].clone());
                        let bottomvec = bottomface.concat(bottomface[0].clone());
                        if (!BIM.simpleMold) {
                            // 侧边
                            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
                            vertices.push(...side[0]);
                            indices.push(...side[1]);
                            facevec.push(...side[2]);
                            count = side[3];

                            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, xzholes, "p_fbk",
                                (a: number, b: number) => [a * cosB, data.SXKH + a * sinB, b])
                        }

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, xzholes, "p_fbk",
                            (a: number, b: number) => [a * cosB, a * sinB, b])


                        CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                            kx = a * cosB;
                            ky = a * sinB;
                            kz = b;
                            return [kx, ky, kz];
                        })



                    }
                    else if (data.p_xzxqtype === XQType.spwx) {
                        cosB = W / WC;
                        sinB = data.XQNXJL / WC;
                        path = data.p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W / cosB),
                            new Vector2(H, W / cosB),
                            new Vector2(H, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W / cosB),
                            new Vector2(data.BKH, (W + lbv) / cosB),
                            new Vector2(data.BKH, data.BKH / cosB),
                            new Vector2((H + rbv), data.BKH / cosB),
                            new Vector2(H, 0)
                        ];


                        topface = [];
                        bottomface = [];
                        for (i = 0; i < path.length; i++) {

                            top = new Vector3(path[i].x, - path[i].y * sinB, path[i].y * cosB);

                            bottom = new Vector3(path[i].x, data.SXKH - path[i].y * sinB, path[i].y * cosB);

                            topface.push(top);
                            bottomface.push(bottom);
                        }

                        let topvec = topface.concat(topface[0].clone());
                        let bottomvec = bottomface.concat(bottomface[0].clone());
                        if (!BIM.simpleMold) {
                            // 侧边
                            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
                            vertices.push(...side[0]);
                            indices.push(...side[1]);
                            facevec.push(...side[2]);
                            count = side[3];

                            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, xzholes, "p_fbk",
                                (a: number, b: number) => [a, data.SXKH - b * sinB, b * cosB])
                        }

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, xzholes, "p_fbk",
                            (a: number, b: number) => [a, - b * sinB, b * cosB])



                        CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                            kx = a;
                            ky = - b * sinB;
                            kz = b * cosB;
                            return [kx, ky, kz];
                        })



                    }
                    else if (data.p_xzxqtype === XQType.spnx) {
                        cosB = W / WC;
                        sinB = data.XQNXJL / WC;
                        path = data.p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W / cosB),
                            new Vector2(H, W / cosB),
                            new Vector2(H, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W / cosB),
                            new Vector2(data.BKH, (W + lbv) / cosB),
                            new Vector2(data.BKH, data.BKH / cosB),
                            new Vector2((H + rbv), data.BKH / cosB),
                            new Vector2(H, 0)
                        ]

                        topface = [];
                        bottomface = [];
                        for (i = 0; i < path.length; i++) {

                            top = new Vector3(path[i].x, path[i].y * sinB, path[i].y * cosB);

                            bottom = new Vector3(path[i].x, data.SXKH + path[i].y * sinB, path[i].y * cosB);

                            topface.push(top);
                            bottomface.push(bottom);
                        }

                        let topvec = topface.concat(topface[0].clone());
                        let bottomvec = bottomface.concat(bottomface[0].clone());
                        if (!BIM.simpleMold) {
                            // 侧边
                            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
                            vertices.push(...side[0]);
                            indices.push(...side[1]);
                            facevec.push(...side[2]);
                            count = side[3];

                            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, path, xzholes, "p_fbk",
                                (a: number, b: number) => [a, data.SXKH + b * sinB, b * cosB])
                        }

                        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, xzholes, "p_fbk",
                            (a: number, b: number) => [a, b * sinB, b * cosB])


                        CommonUtils.getGMTHolesToKongPoint(syholes, data.kongpoint, 1, false, false, false, (a: number, b: number) => {
                            kx = a;
                            ky = b * sinB;
                            kz = b * cosB;
                            return [kx, ky, kz];
                        })

                    }
                    else {
                        if (data.p_xzfentype === XQType.mf) {
                            path = [
                                new Vector2(0, 0),
                                new Vector2(0, W),
                                new Vector2(H, W),
                                new Vector2(H, 0)
                            ]
                            sfface = [];
                            for (i = 0; i < path.length; i++) {
                                sfface.push(new Vector3(path[i].x, 0, path[i].y))
                            }
                            if (BIM.simpleMold) {
                                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                                    (a: number, b: number) => [a, 0, b]);
                            }
                            else {
                                count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, data.SXKH, 0, false, null);
                            }
                        }
                        else {
                            path = [
                                new Vector2(0, 0),
                                new Vector2(0, W),
                                new Vector2(data.BKH, W + lbv),
                                new Vector2(data.BKH, data.BKH),
                                new Vector2((H + rbv), data.BKH),
                                new Vector2(H, 0)
                            ]
                            sfface = [];
                            for (i = 0; i < path.length; i++) {
                                sfface.push(new Vector3(path[i].x, 0, path[i].y))
                            }
                            if (BIM.simpleMold) {
                                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, xzholes, "p_fbk",
                                    (a: number, b: number) => [a, 0, b]);
                            }
                            else {
                                count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, xzholes, 2, data.SXKH, 0, false, "p_fbk");
                            }

                            data.kongpoint.push(...kongpoint);
                        }
                    }
                }
            }
        }

        // 易拆
        if (data.p_yctype === 3 && Number(data.xqbj) > 0 && Number(data.zyxqjl) > 0) {
            // 左右斜切
            count = SlotUtils.getYiChaiVI(count, vertices, indices, facevec, holes, lbv, rbv, W, H, HC, Number(data.zyxqjl), data.BKH, data.SXKH, L - Number(data.xqbj), true);
            count = SlotUtils.getYiChaiVI(count, vertices, indices, facevec, holes, lbv, rbv, W, H, HC, Number(data.zyxqjl), data.BKH, data.SXKH, Number(data.xqbj), false);
        }
        else if (data.p_yctype === 2) {
            // 右切
            count = SlotUtils.getYiChaiVI(count, vertices, indices, facevec, holes, lbv, rbv, W, H, HC, data.YCJL, data.BKH, data.SXKH, L / 2, true);
        }
        else if (data.p_yctype === 1) {
            // 左切
            count = SlotUtils.getYiChaiVI(count, vertices, indices, facevec, holes, lbv, rbv, W, H, HC, data.YCJL, data.BKH, data.SXKH, L / 2, false);
        }

        let zybkh = BIM.simpleMold ? 0 : data.ZYKH;
        let gmhd = BIM.simpleMold ? 0 : data.GMT;
        // 横肋
        let hldw = AModelFmulaUtils.getHolesbyExpress(data.p_hldw, L, 2, data, AK.p_hldw);
        if (data.HLW && data.HLW > 0 && hldw && hldw.length > 0) {

            if (H === 50 && W != 50) {
                path = [
                    new Vector2(gmhd, zybkh),
                    new Vector2(gmhd, W - zybkh),
                    new Vector2(data.BKH, W - zybkh + lbv),
                    new Vector2(data.BKH, zybkh)
                ]
            }
            else if (W === 50 && H != 50) {
                path = [
                    new Vector2(zybkh, gmhd),
                    new Vector2(zybkh, data.BKH),
                    new Vector2(H - zybkh + rbv, data.BKH),
                    new Vector2(H - zybkh, gmhd)
                ]
            }
            else {
                path = [
                    new Vector2(gmhd, gmhd),
                    new Vector2(gmhd, W - zybkh),
                    new Vector2(data.BKH, W - zybkh + lbv),
                    new Vector2(data.BKH, data.BKH),
                    new Vector2(H - zybkh + rbv, data.BKH),
                    new Vector2(H - zybkh, gmhd)
                ]
            }

            let pos: number, tt: number;
            for (let i = 0; i < hldw.length; i++) {
                pos = hldw[i]
                if (BIM.simpleMold) {
                    sfface = [];
                    for (tt = 0; tt < path.length; tt++) {
                        sfface.push(new Vector3(path[tt].x, pos, path[tt].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, sfface, path, null, null,
                        (a: number, b: number) => [a, pos, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null,
                        2, pos + data.HLW / 2, pos - data.HLW / 2, false, null);
                }

            }
        }
        return [vertices, indices, facevec];
    }

    /**
     * 内/外转角 C 槽
     * @param data 
     * @param outer 
     * @returns 
     */
    static getSlotCornerVI(data: ALParams, outer: boolean): any[] {
        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;
        let angle = (data.p_jiajiao !== 0 && data.p_jiajiao % 180 === 0) ? data.p_jiajiao - 0.001 : data.p_jiajiao;

        let actualAg = outer ? (360 - angle) : angle;
        let radian = outer ? (360 - angle) / 180 * Math.PI : angle / 180 * Math.PI;
        let cosA = Math.cos(radian);
        let sinA = Math.sin(radian);

        let radianBan = data.p_jiajiao / 2 / 180 * Math.PI;
        let tanC = Math.tan(radianBan);
        let minRX = actualAg > 180 ? -data.BKH / Math.abs(tanC) : data.BKH / Math.abs(tanC);

        // 基础数据
        let ZYL = Number(data.zyL);
        let ZYW = Number(data.zyW);
        let YYL = Number(data.yyL);
        let YYW = Number(data.yyW);
        let H = Number(data.H);
        let XQNXJL = Number(data.XQNXJL);
        let ZYYJXKH: number = Number(data.ZYYJXKH);
        let GMT: number = Number(data.GMT);

        // if (ZYL <= YYW) {
        //     ZYL = YYW + 0.01;
        //     data.zyL = YYW;
        // }
        // if (YYL <= ZYW) {
        //     YYL = ZYW + 0.01
        //     data.yyL = ZYW;
        // }

        // let filterNum: number = 0;
        let tpath = CommonUtils.getCornerPath(0, YYW, ZYW, ZYL, YYL, sinA, cosA);
        let zx = tpath[1];
        let yp = tpath[5];
        let mid = tpath[3];
        let ss1 = tpath[2];
        let ss2 = tpath[4];
        let zx2 = tpath[2].clone().add(zx).multiplyScalar(0.5);
        let ztpath = CommonUtils.getCornerPath(0, YYW / 2, ZYW / 2, ZYL, YYL, sinA, cosA);
        let ztp = ztpath[3];

        data.duan = [
            0, 0, 0,
            zx.x, 0, zx.y,
            ss1.x, 0, ss1.y,
            mid.x, 0, mid.y,
            ss2.x, 0, ss2.y,
            yp.x, 0, yp.y,
            0, -H, 0,
            zx.x, -H, zx.y,
            yp.x, -H, yp.y
        ]

        data.zhong = {
            zyL: [
                {
                    pointer: [zx.x, -H / 2, zx.y],
                    center: [zx.x / 2, -H / 2, zx.y / 2],
                    dir: [zx.x, 0, zx.y]
                },
                {
                    pointer: [zx2.x, 0, zx2.y],
                    center: [ztp.x, 0, ztp.y],
                    dir: [zx.x, 0, zx.y]
                }
            ],
            yyL: [
                {
                    pointer: [YYL, 0, YYW / 2],
                    center: [YYL / 2, 0, YYW / 2],
                    dir: [YYL, 0, 0]
                },
                {
                    pointer: [YYL, -H / 2, 0],
                    center: [YYL / 2, -H / 2, 0],
                    dir: [YYL, 0, 0]
                }
            ]
        }

        data.kongpoint = [];
        data.gmholes = [];

        let kongpoint = [];
        let kx: number, ky: number, kz: number;

        let path: Vector2[];
        let holes: Path[], bholes: Path[], fholes: Path[];
        let holePath: Path;

        let xv: number, yv: number, i: number;
        let backface: Vector3[], frontface: Vector3[];
        let backpath: Vector2[], fontpath: Vector2[];
        let fontp: any[], backp: any[];
        let side: any[];

        let iszywequal = ZYW === 50 && YYW === 50;
        // 垂直斜切
        let leftXie = (H === 50 || iszywequal) ? 0 : data.p_zyxqtype === XQType.spwx ? XQNXJL : data.p_zyxqtype === XQType.spnx ? -XQNXJL : 0;
        let rightXie = (H === 50 || iszywequal) ? 0 : data.p_yyxqtype === XQType.spwx ? XQNXJL : data.p_yyxqtype === XQType.spnx ? -XQNXJL : 0;
        // 水平斜切
        let leftQie = (H === 50 || iszywequal) ? 0 : data.p_zyxqtype === XQType.czwx ? XQNXJL : data.p_zyxqtype === XQType.cznx ? -XQNXJL : 0;
        let rightQie = (H === 50 || iszywequal) ? 0 : data.p_yyxqtype === XQType.czwx ? XQNXJL : data.p_yyxqtype === XQType.cznx ? -XQNXJL : 0;

        // 顶面
        let szyw = iszywequal ? data.BKH + ZYW : ZYW;
        let syyw = iszywequal ? data.BKH + YYW : YYW;

        path = CommonUtils.getCornerPath(0, syyw, szyw, ZYL, YYL, sinA, cosA);
        path[2].x += leftXie * cosA;
        path[2].y += leftXie * sinA;
        path[4].x += rightXie;

        let bpath = CommonUtils.getCornerPath(0, syyw, szyw, ZYL + (GMT / H) * leftQie, YYL + (GMT / H) * rightQie, sinA, cosA);
        bpath[2].x += leftXie * cosA;
        bpath[2].y += leftXie * sinA;
        bpath[4].x += rightXie;

        // 顶面左翼
        holes = [];
        let tlpath = [
            path[0],
            path[1],
            path[2],
            path[3]
        ];

        let tlbpath = [
            bpath[0],
            bpath[1],
            bpath[2],
            bpath[3]
        ]

        let tlface = [
            new Vector3(path[0].x, 0, path[0].y),
            new Vector3(path[1].x, 0, path[1].y),
            new Vector3(path[2].x, 0, path[2].y),
            new Vector3(path[3].x, 0, path[3].y)
        ]

        let tlbface = [
            new Vector3(bpath[0].x, -GMT, bpath[0].y),
            new Vector3(bpath[1].x, -GMT, bpath[1].y),
            new Vector3(bpath[2].x, -GMT, bpath[2].y),
            new Vector3(bpath[3].x, -GMT, bpath[3].y)
        ]

        let tldw1 = SlotUtils.getTLkw(data.p_tl_r1dw, sinA, cosA, tlpath, data.p_tl_r1.toString());
        let tldw2 = SlotUtils.getTLkw(data.p_tl_r2dw, sinA, cosA, tlpath, data.p_tl_r2.toString());
        let tldw3 = SlotUtils.getTLkw(data.p_tl_r3dw, sinA, cosA, tlpath, data.p_tl_r3.toString());

        data.p_tl_r1dw = tldw1[1];
        data.p_tl_r2dw = tldw2[1];
        data.p_tl_r3dw = tldw3[1];

        let rag = radian;

        let gmtpath = CommonUtils.getCornerPath(0, syyw, szyw, ZYL, YYL, sinA, cosA);
        let gmldir = gmtpath[1].clone().sub(gmtpath[0]).normalize();
        let gmwdir = gmtpath[2].clone().sub(gmtpath[1]).normalize();

        CommonUtils.getXieHoles(data.p_tl_r1, tldw1[0], holes, rag, sinA, cosA, gmldir, gmwdir);
        CommonUtils.getXieHoles(data.p_tl_r2, tldw2[0], holes, rag, sinA, cosA, gmldir, gmwdir);
        CommonUtils.getXieHoles(data.p_tl_r3, tldw3[0], holes, rag, sinA, cosA, gmldir, gmwdir);


        CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 1)

        data.gmholes.push(CommonUtils.getXieHolesData(data.p_tl_r1, tldw1[0], rag, sinA, cosA, gmldir, gmwdir, ConstDef.ynormal.clone()));
        data.gmholes.push(CommonUtils.getXieHolesData(data.p_tl_r2, tldw2[0], rag, sinA, cosA, gmldir, gmwdir, ConstDef.ynormal.clone()));
        data.gmholes.push(CommonUtils.getXieHolesData(data.p_tl_r3, tldw3[0], rag, sinA, cosA, gmldir, gmwdir, ConstDef.ynormal.clone()));


        if (iszywequal) {
            let filterNum = 0;
            let zysk1 = AModelFmulaUtils.getHolesbyExpress(data.p_zysk, ZYL, 2, data, AK.p_zysk);
            let minxx = (data.BKH + ZYW) / tanC;
            for (i = 0; i < zysk1.length; i++) {
                xv = zysk1[i] * cosA + (data.BKH - data.BKKJMDis + ZYW) * sinA;
                yv = zysk1[i] * sinA - (data.BKH - data.BKKJMDis + ZYW) * cosA;
                // 过滤孔
                if (zysk1[i] < minxx + data.BKDia / 2 || zysk1[i] > ZYL - data.BKDia / 2) {
                    filterNum++;
                    continue;
                }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }

            AModelFmulaUtils.getHolesbyExpress(data.p_zysk, ZYL, 2, data, AK.p_zysk, filterNum);



            let tmppath = CommonUtils.getCornerPath(0, ZYW, YYW, ZYL, YYL, sinA, cosA);
            tmppath[2].x += leftXie * cosA;
            tmppath[2].y += leftXie * sinA;
            tmppath[4].x += rightXie;

            let tmpspath = CommonUtils.getCornerPath(ZYW, ZYW + data.BKH, ZYW + data.BKH, ZYL, YYL, sinA, cosA);
            tmpspath[2].x += leftXie * cosA;
            tmpspath[2].y += leftXie * sinA;
            tmpspath[4].x += rightXie;

            facevec.push({
                key: AK.p_tl_r1dw, faces: [
                    new Vector3(tmppath[0].x, 0, tmppath[0].y),
                    new Vector3(tmppath[1].x, 0, tmppath[1].y),
                    new Vector3(tmppath[2].x, 0, tmppath[2].y),
                    new Vector3(tmppath[3].x, 0, tmppath[3].y)
                ]
            })
            facevec.push({
                key: AK.p_zysk, faces: [

                    new Vector3(tmpspath[0].x, 0, tmpspath[0].y),
                    new Vector3(tmpspath[1].x, 0, tmpspath[1].y),
                    new Vector3(tmpspath[2].x, 0, tmpspath[2].y),
                    new Vector3(tmpspath[3].x, 0, tmpspath[3].y)

                ]
            })

        }
        else {

            facevec.push({
                key: AK.p_tl_r1dw, faces: [

                    new Vector3(path[0].x, 0, path[0].y),
                    new Vector3(path[1].x, 0, path[1].y),
                    new Vector3(path[2].x, 0, path[2].y),
                    new Vector3(path[3].x, 0, path[3].y)
                ]
            })
        }

        if (!BIM.simpleMold) {
            // 侧边
            side = CommonUtils.getSideVIF([...tlface, tlface[0]], [...tlbface, tlbface[0]], count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
            //底
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, tlbface, tlbpath, holes, null,
                (a: number, b: number) => [a, -GMT, b]);
        }
        // 顶
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, tlface, tlpath, holes, null,
            (a: number, b: number) => [a, 0, b]);


        // 顶面右翼

        let trpath = [
            path[0],
            path[3],
            path[4],
            path[5]
        ]

        let trbpath = [
            bpath[0],
            bpath[3],
            bpath[4],
            bpath[5]
        ]

        let trface = [
            new Vector3(path[0].x, 0, path[0].y),
            new Vector3(path[3].x, 0, path[3].y),
            new Vector3(path[4].x, 0, path[4].y),
            new Vector3(path[5].x, 0, path[5].y)
        ]

        let trbface = [
            new Vector3(bpath[0].x, -GMT, bpath[0].y),
            new Vector3(bpath[3].x, -GMT, bpath[3].y),
            new Vector3(bpath[4].x, -GMT, bpath[4].y),
            new Vector3(bpath[5].x, -GMT, bpath[5].y)
        ]

        holes = [];

        data.p_tr_r1 = CommonUtils.checkRadiusIsLegal(data.p_tr_r1);
        data.p_tr_r2 = CommonUtils.checkRadiusIsLegal(data.p_tr_r2);
        data.p_tr_r3 = CommonUtils.checkRadiusIsLegal(data.p_tr_r3);

        data.p_tr_r1dw = CommonUtils.fliterOuterPoint(data.p_tr_r1dw, trpath, true, false, false, true, data.p_tr_r1.toString());
        data.p_tr_r2dw = CommonUtils.fliterOuterPoint(data.p_tr_r2dw, trpath, true, false, false, true, data.p_tr_r2.toString());
        data.p_tr_r3dw = CommonUtils.fliterOuterPoint(data.p_tr_r3dw, trpath, true, false, false, true, data.p_tr_r3.toString());

        CommonUtils.getGmtHoles(data.p_tr_r1, data.p_tr_r1dw, holes, 1);
        CommonUtils.getGmtHoles(data.p_tr_r2, data.p_tr_r2dw, holes, 1);
        CommonUtils.getGmtHoles(data.p_tr_r3, data.p_tr_r3dw, holes, 1);

        CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 1);

        data.gmholes.push(CommonUtils.getHolesData(data.p_tr_r1, data.p_tr_r1dw, 1, ConstDef.ynormal.clone(), false, true));
        data.gmholes.push(CommonUtils.getHolesData(data.p_tr_r2, data.p_tr_r2dw, 1, ConstDef.ynormal.clone(), false, true));
        data.gmholes.push(CommonUtils.getHolesData(data.p_tr_r3, data.p_tr_r3dw, 1, ConstDef.ynormal.clone(), false, true));

        if (iszywequal) {
            let filterNum = 0;
            let yysk1 = AModelFmulaUtils.getHolesbyExpress(data.p_yysk, YYL, 2, data, AK.p_yysk);
            let minxx = (data.BKH + ZYW) / tanC;
            for (i = 0; i < yysk1.length; i++) {
                xv = yysk1[i];
                yv = data.BKH - data.BKKJMDis + YYW;

                // 过滤孔
                if (xv < minxx + data.BKDia / 2 || xv > YYL - data.BKDia / 2) {
                    filterNum++;
                    continue;
                }
                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
            }

            AModelFmulaUtils.getHolesbyExpress(data.p_yysk, YYL, 2, data, AK.p_yysk, filterNum);


            let tmppath = CommonUtils.getCornerPath(0, ZYW, YYW, ZYL, YYL, sinA, cosA);
            tmppath[2].x += leftXie * cosA;
            tmppath[2].y += leftXie * sinA;
            tmppath[4].x += rightXie;


            let tmpspath = CommonUtils.getCornerPath(ZYW, ZYW + data.BKH, ZYW + data.BKH, ZYL, YYL, sinA, cosA);
            tmpspath[2].x += leftXie * cosA;
            tmpspath[2].y += leftXie * sinA;
            tmpspath[4].x += rightXie;

            facevec.push({
                key: AK.p_tr_r1dw, faces: [
                    new Vector3(tmppath[0].x, 0, tmppath[0].y),
                    new Vector3(tmppath[3].x, 0, tmppath[3].y),
                    new Vector3(tmppath[4].x, 0, tmppath[4].y),
                    new Vector3(tmppath[5].x, 0, tmppath[5].y)
                ]
            })
            facevec.push({
                key: AK.p_yysk, faces: [

                    new Vector3(tmpspath[0].x, 0, tmpspath[0].y),
                    new Vector3(tmpspath[3].x, 0, tmpspath[3].y),
                    new Vector3(tmpspath[4].x, 0, tmpspath[4].y),
                    new Vector3(tmpspath[5].x, 0, tmpspath[5].y)

                ]
            })
        }
        else {
            facevec.push({
                key: AK.p_tr_r1dw, faces: [
                    new Vector3(path[0].x, 0, path[0].y),
                    new Vector3(path[3].x, 0, path[3].y),
                    new Vector3(path[4].x, 0, path[4].y),
                    new Vector3(path[5].x, 0, path[5].y)
                ]
            })
        }

        if (!BIM.simpleMold) {
            // 侧边
            side = CommonUtils.getSideVIF([...trface, trface[0]], [...trbface, trbface[0]], count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
            //底
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, trbface, trbpath, holes, null,
                (a: number, b: number) => [a, -GMT, b]);
        }
        // 顶
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, trface, trpath, holes, null,
            (a: number, b: number) => [a, 0, b]);

        // 底面
        if (H !== 50) {
            path = CommonUtils.getCornerPath(0, data.BKH, data.BKH, ZYL + leftQie, YYL + rightQie, sinA, cosA);
            path[2].x += data.BKH / ZYW * leftXie * cosA;
            path[2].y += data.BKH / ZYW * leftXie * sinA;
            path[4].x += data.BKH / YYW * rightXie;

            bpath = CommonUtils.getCornerPath(0, data.BKH, data.BKH, ZYL + (H - data.ZYYJXKH) / H * leftQie, YYL + (H - data.ZYYJXKH) / H * rightQie, sinA, cosA);
            bpath[2].x += data.BKH / ZYW * leftXie * cosA;
            bpath[2].y += data.BKH / ZYW * leftXie * sinA;
            bpath[4].x += data.BKH / YYW * rightXie;

            let zyxpath = [
                path[0],
                path[1],
                path[2],
                path[3]
            ];

            let zyspath = [
                bpath[0],
                bpath[1],
                bpath[2],
                bpath[3]
            ]

            let zyxiaface = [
                new Vector3(path[0].x, -H, path[0].y),
                new Vector3(path[1].x, -H, path[1].y),
                new Vector3(path[2].x, -H, path[2].y),
                new Vector3(path[3].x, -H, path[3].y)
            ]

            let zyshangface = [
                new Vector3(bpath[0].x, -H + ZYYJXKH, bpath[0].y),
                new Vector3(bpath[1].x, -H + ZYYJXKH, bpath[1].y),
                new Vector3(bpath[2].x, -H + ZYYJXKH, bpath[2].y),
                new Vector3(bpath[3].x, -H + ZYYJXKH, bpath[3].y)
            ]

            let yyxpath = [
                path[0],
                path[3],
                path[4],
                path[5]
            ];

            let yyspath = [
                bpath[0],
                bpath[3],
                bpath[4],
                bpath[5]
            ];

            let yyxiaface = [
                new Vector3(path[0].x, -H, path[0].y),
                new Vector3(path[3].x, -H, path[3].y),
                new Vector3(path[4].x, -H, path[4].y),
                new Vector3(path[5].x, -H, path[5].y)
            ]

            let yyshangface = [
                new Vector3(bpath[0].x, -H + ZYYJXKH, bpath[0].y),
                new Vector3(bpath[3].x, -H + ZYYJXKH, bpath[3].y),
                new Vector3(bpath[4].x, -H + ZYYJXKH, bpath[4].y),
                new Vector3(bpath[5].x, -H + ZYYJXKH, bpath[5].y)
            ]


            holes = [];
            // 左翼下框平孔
            let kongpoint = [];
            let zyxbkk = AModelFmulaUtils.getHolesbyExpress(data.p_zyxkpk, ZYL + leftQie, 2, data, AK.p_zyxkpk);
            let filterNum = 0;
            let i: number, xv: number, yv: number;
            let holePath: Path;
            for (i = 0; i < zyxbkk.length; i++) {
                xv = zyxbkk[i] * cosA + (data.BKH - data.BKKJMDis) * sinA;
                yv = zyxbkk[i] * sinA - (data.BKH - data.BKKJMDis) * cosA;
                // 过滤孔
                if (zyxbkk[i] < minRX + data.BKDia / 2) {
                    filterNum++;
                    continue;
                }
                if (zyxbkk[i] > ZYL + leftQie - data.BKDia / 2) {
                    continue;
                }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(xv, yv, 0);
            }
            AModelFmulaUtils.getHolesbyExpress(data.p_zyxkpk, ZYL + leftQie, 2, data, AK.p_zyxkpk, filterNum);
            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                kx = a;
                ky = -H;
                kz = b;

                return [kx, ky, kz];
            });
            data.kongpoint.push(...kongpoint);

            if (!BIM.simpleMold) {
                // 侧边
                side = CommonUtils.getSideVIF([...zyshangface, zyshangface[0]], [...zyxiaface, zyxiaface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, zyshangface, zyspath, holes, AK.p_zyxkpk,
                    (a: number, b: number) => [a, -H + data.ZYYJXKH, b]);
            }

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, zyxiaface, zyxpath, holes, AK.p_zyxkpk,
                (a: number, b: number) => [a, -H, b]);


            // 右翼下框平孔
            kongpoint = [];
            holes = [];
            let yyxbkk = AModelFmulaUtils.getHolesbyExpress(data.p_yyxkpk, YYL + rightQie, 2, data, AK.p_yyxkpk);
            filterNum = 0;
            for (i = 0; i < yyxbkk.length; i++) {
                xv = yyxbkk[i];
                yv = data.BKH - data.BKKJMDis;

                // 过滤孔
                if (xv < minRX + data.BKDia / 2) {
                    filterNum++;
                    continue;
                }
                if (xv > YYL + rightQie - data.BKDia / 2) {
                    continue;
                }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
                kongpoint.push(xv, yv, 0);
            }
            AModelFmulaUtils.getHolesbyExpress(data.p_yyxkpk, YYL + rightQie, 2, data, AK.p_yyxkpk, filterNum);

            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                kx = a;
                ky = -H;
                kz = b;

                return [kx, ky, kz];
            });
            data.kongpoint.push(...kongpoint);

            if (!BIM.simpleMold) {
                // 侧边
                side = CommonUtils.getSideVIF([...yyshangface, yyshangface[0]], [...yyxiaface, yyxiaface[0]], count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, yyshangface, yyspath, holes, AK.p_yyxkpk,
                    (a: number, b: number) => [a, -H + data.ZYYJXKH, b]);
            }

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, yyxiaface, yyxpath, holes, AK.p_yyxkpk,
                (a: number, b: number) => [a, -H, b]);
        }


        // 转角点
        let xx: number = data.ZYYFBH / sinA + data.ZYYFBH / sinA * cosA;
        // 左侧面孔
        let zch = H === 50 ? data.BKH + H : H;

        fontp = CommonUtils.getLeftXieVi(0, 0, ZYL, sinA, cosA);
        backp = CommonUtils.getLeftXieVi(data.ZYYFBH, data.ZYYFBH, ZYL + data.ZYYFBH / ZYW * leftXie, sinA, cosA);

        fontpath = [
            new Vector2(0, 0),
            new Vector2(fontp[2], 0),
            new Vector2(fontp[2] + leftQie, -zch),
            new Vector2(0, -zch)
        ]
        frontface = CommonUtils.getLeftXieFaceVI(0, 0, ZYL, -zch, 0, sinA, cosA, leftQie);

        backpath = [
            new Vector2(0, 0),
            new Vector2(backp[2], 0),
            new Vector2(backp[2] + leftQie, -zch),
            new Vector2(0, -zch)
        ]
        backface = CommonUtils.getLeftXieFaceVI(data.ZYYFBH, data.ZYYFBH, ZYL + data.ZYYFBH / ZYW * leftXie, -zch, 0, sinA, cosA, leftQie);

        data.p_l_r1 = CommonUtils.checkRadiusIsLegal(data.p_l_r1);
        data.p_l_r2 = CommonUtils.checkRadiusIsLegal(data.p_l_r2);
        data.p_l_r3 = CommonUtils.checkRadiusIsLegal(data.p_l_r3);

        data.p_l_r1dw = CommonUtils.fliterOuterPoint(data.p_l_r1dw, fontpath, true, true, false, true, data.p_l_r1.toString());
        data.p_l_r2dw = CommonUtils.fliterOuterPoint(data.p_l_r2dw, fontpath, true, true, false, true, data.p_l_r2.toString());
        data.p_l_r3dw = CommonUtils.fliterOuterPoint(data.p_l_r3dw, fontpath, true, true, false, true, data.p_l_r3.toString());

        fholes = [];
        CommonUtils.getGmtHoles(data.p_l_r1, data.p_l_r1dw, fholes, 1, true);
        CommonUtils.getGmtHoles(data.p_l_r2, data.p_l_r2dw, fholes, 1, true);
        CommonUtils.getGmtHoles(data.p_l_r3, data.p_l_r3dw, fholes, 1, true);

        CommonUtils.getGMTHolesToKongPoint(fholes, data.kongpoint, 0, false, false, false, (a: number, b: number) => {
            return [a * cosA, b, a * sinA];
        })

        bholes = [];
        CommonUtils.getGmtHoles(data.p_l_r1, data.p_l_r1dw, bholes, 1, true, backp[2] - fontp[2]);
        CommonUtils.getGmtHoles(data.p_l_r2, data.p_l_r2dw, bholes, 1, true, backp[2] - fontp[2]);
        CommonUtils.getGmtHoles(data.p_l_r3, data.p_l_r3dw, bholes, 1, true, backp[2] - fontp[2]);

        let ltpath = CommonUtils.getCornerPath(0, syyw, szyw, ZYL, YYL, sinA, cosA);
        let lgmdir = ltpath[2].clone().sub(ltpath[1]).normalize();
        let lnor = new Vector3(lgmdir.x, 0, lgmdir.y);
        data.gmholes.push(CommonUtils.getCHolesData(data.p_l_r1, data.p_l_r1dw, sinA, cosA, lnor.clone()));
        data.gmholes.push(CommonUtils.getCHolesData(data.p_l_r2, data.p_l_r2dw, sinA, cosA, lnor.clone()));
        data.gmholes.push(CommonUtils.getCHolesData(data.p_l_r3, data.p_l_r3dw, sinA, cosA, lnor.clone()));


        if (H === 50) {

            fholes = [];
            kongpoint = [];
            // 左翼下框平孔
            let zyxkpk50 = AModelFmulaUtils.getHolesbyExpress(data.p_zyxkpk, ZYL, 2, data, AK.p_zyxkpk);

            for (i = 0; i < zyxkpk50.length; i++) {
                xv = zyxkpk50[i];
                yv = -(data.BKH - data.BKKJMDis) - H;

                // 过滤孔
                if (zyxkpk50[i] > ZYL - data.BKDia / 2) {
                    continue;
                }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                fholes.push(holePath);

                kongpoint.push(xv, yv, 0);
            }
            // AModelFmulaUtils.getHolesbyExpress(data.p_zyxkpk, ZYL, 2, data, AK.p_zyxkpk, filterNum);
            bholes = [];
            for (i = 0; i < zyxkpk50.length; i++) {
                xv = zyxkpk50[i] + backp[2] - fontp[2];
                yv = -(data.BKH - data.BKKJMDis) - H;

                // if (zysk[i] > backp[2] - data.BKDia / 2) {
                //     continue;
                // }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                bholes.push(holePath);

            }

            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                kx = a * cosA;
                ky = b;
                kz = a * sinA;

                return [kx, ky, kz];
            });
            data.kongpoint.push(...kongpoint);


            let lgmface = CommonUtils.getLeftXieFaceVI(0, 0, ZYL, -H, 0, sinA, cosA, leftQie);
            let lskface = CommonUtils.getLeftXieFaceVI(0, 0, ZYL, -data.BKH - H, -H, sinA, cosA, leftQie);
            facevec.push({
                key: AK.p_l_r1dw, faces: [
                    ...lgmface
                ]
            })
            facevec.push({
                key: AK.p_zyxkpk, faces: [
                    ...lskface
                ]
            })

            if (BIM.simpleMold) {
                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, fontpath, fholes, null,
                    (a: number, b: number) => [a * cosA, b, a * sinA]);
            }
            else {
                count = CommonUtils.getLeftHoleVI(count, vertices, indices, facevec, fholes, bholes, fontpath, backpath, frontface, backface,
                    data.ZYYFBH, data.ZYYFBH, data.ZYYFBH, sinA, cosA, null);
            }
        }
        else {
            if (BIM.simpleMold) {
                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, fontpath, fholes, AK.p_l_r1dw,
                    (a: number, b: number) => [a * cosA, b, a * sinA]);
            }
            else {
                count = CommonUtils.getLeftHoleVI(count, vertices, indices, facevec, fholes, bholes, fontpath, backpath, frontface, backface,
                    data.ZYYFBH, data.ZYYFBH, data.ZYYFBH, sinA, cosA, AK.p_l_r1dw);
            }

        }


        // 右侧面孔
        let ych = H === 50 ? data.BKH + H : H;
        backpath = [
            new Vector2(0, 0),
            new Vector2(0, -ych),
            new Vector2(YYL + rightQie, -ych),
            new Vector2(YYL, 0)
        ]

        backface = [
            new Vector3(0, 0, 0),
            new Vector3(0, -ych, 0),
            new Vector3(YYL + rightQie, -ych, 0),
            new Vector3(YYL, 0, 0)
        ]

        fontpath = [
            new Vector2(xx, 0),
            new Vector2(xx, -ych),
            new Vector2(YYL + rightQie + data.ZYYFBH / YYW * rightXie, -ych),
            new Vector2(YYL + + data.ZYYFBH / YYW * rightXie, 0)
        ]

        frontface = [
            new Vector3(xx, 0, data.ZYYFBH),
            new Vector3(xx, -ych, data.ZYYFBH),
            new Vector3(YYL + rightQie + data.ZYYFBH / YYW * rightXie, -ych, data.ZYYFBH),
            new Vector3(YYL + data.ZYYFBH / YYW * rightXie, 0, data.ZYYFBH)
        ];

        data.p_r_r1 = CommonUtils.checkRadiusIsLegal(data.p_r_r1);
        data.p_r_r2 = CommonUtils.checkRadiusIsLegal(data.p_r_r2);
        data.p_r_r3 = CommonUtils.checkRadiusIsLegal(data.p_r_r3);

        data.p_r_r1dw = CommonUtils.fliterOuterPoint(data.p_r_r1dw, backpath, true, true, false, true, data.p_r_r1.toString());
        data.p_r_r2dw = CommonUtils.fliterOuterPoint(data.p_r_r2dw, backpath, true, true, false, true, data.p_r_r2.toString());
        data.p_r_r3dw = CommonUtils.fliterOuterPoint(data.p_r_r3dw, backpath, true, true, false, true, data.p_r_r3.toString());

        holes = [];
        CommonUtils.getGmtHoles(data.p_r_r1, data.p_r_r1dw, holes, 1, true);
        CommonUtils.getGmtHoles(data.p_r_r2, data.p_r_r2dw, holes, 1, true);
        CommonUtils.getGmtHoles(data.p_r_r3, data.p_r_r3dw, holes, 1, true);

        CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 2);

        data.gmholes.push(CommonUtils.getHolesData(data.p_r_r1, data.p_r_r1dw, 1, ConstDef.znormal.clone(), true));
        data.gmholes.push(CommonUtils.getHolesData(data.p_r_r2, data.p_r_r2dw, 1, ConstDef.znormal.clone(), true));
        data.gmholes.push(CommonUtils.getHolesData(data.p_r_r3, data.p_r_r3dw, 1, ConstDef.znormal.clone(), true));

        if (H === 50) {
            holes = [];
            kongpoint = [];
            let yyxkpk50 = AModelFmulaUtils.getHolesbyExpress(data.p_yyxkpk, YYL, 2, data, AK.p_yyxkpk);
            // filterNum = 0;
            for (i = 0; i < yyxkpk50.length; i++) {
                xv = yyxkpk50[i];
                yv = -(data.BKH - data.BKKJMDis) - H;

                // 过滤孔
                if (yv > YYL - data.BKDia / 2) {
                    // filterNum++;
                    continue;
                }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(xv, yv, 0);
            }

            data.kongpoint.push(...kongpoint);
            // AModelFmulaUtils.getHolesbyExpress(data.p_yyxkpk, YYL, 2, data, AK.p_yyxkpk, filterNum);




            facevec.push({
                key: AK.p_yyxkpk, faces: [
                    new Vector3(0, -H, 0),
                    new Vector3(0, -H - data.BKH, 0),
                    new Vector3(YYL + rightQie, -H - data.BKH, 0),
                    new Vector3(YYL, -H, 0)
                ]
            })
        }

        facevec.push({
            key: AK.p_r_r1dw, faces: [
                new Vector3(0, 0, 0),
                new Vector3(0, -H, 0),
                new Vector3(YYL + rightQie, -H, 0),
                new Vector3(YYL, 0, 0)
            ]
        })

        if (BIM.simpleMold) {
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, backface, backpath, holes, null,
                (a: number, b: number) => [a, b, 0]);
        }
        else {

            count = CommonUtils.getHolePathFace(count, vertices, indices, facevec, backpath, holes, backface, cosA, sinA, ZYW, YYW, 0, null, 0);
            count = CommonUtils.getHolePathFace(count, vertices, indices, facevec, fontpath, holes, frontface, cosA, sinA, ZYW, YYW, data.ZYYFBH, null, 0, true);

            // 封边
            // 顶点
            vertices.push(backface[3].x, backface[3].y, backface[3].z);
            vertices.push(backface[2].x, backface[2].y, backface[2].z);

            vertices.push(frontface[3].x, frontface[3].y, frontface[3].z);
            vertices.push(frontface[2].x, frontface[2].y, frontface[2].z);

            // 索引
            indices.push(count, count + 2, count + 1);
            indices.push(count + 2, count + 3, count + 1);

            count += 4;

            // 下
            vertices.push(backface[2].x, backface[2].y, backface[2].z);
            vertices.push(backface[1].x, backface[1].y, backface[1].z);

            vertices.push(frontface[2].x, frontface[2].y, frontface[2].z);
            vertices.push(frontface[1].x, frontface[1].y, frontface[1].z);

            // 索引
            indices.push(count, count + 2, count + 1);
            indices.push(count + 2, count + 3, count + 1);

            count += 4;

            vertices.push(backface[0].x, backface[0].y, backface[0].z);
            vertices.push(backface[3].x, backface[3].y, backface[3].z);

            vertices.push(frontface[0].x, frontface[0].y, frontface[0].z);
            vertices.push(frontface[3].x, frontface[3].y, frontface[3].z);

            // 索引
            indices.push(count, count + 2, count + 1);
            indices.push(count + 2, count + 3, count + 1);

            count += 4;
        }


        // 左翼竖孔
        if (!iszywequal) {

            fontp = CommonUtils.getLeftXieVi(ZYW - data.ZYYJXKH, YYW - data.ZYYJXKH, ZYL + (ZYW - data.ZYYJXKH) / ZYW * leftXie, sinA, cosA);
            backp = CommonUtils.getLeftXieVi(ZYW, YYW, ZYL + leftXie, sinA, cosA);

            backpath = [
                new Vector2(0, 0),
                new Vector2(backp[2], 0),
                new Vector2(backp[2] + data.BKH / H * leftQie, -data.BKH),
                new Vector2(0, -data.BKH)
            ]

            backface = CommonUtils.getLeftXieFaceVI(ZYW - data.ZYYJXKH, YYW - data.ZYYJXKH, ZYL + (ZYW - data.ZYYJXKH) / ZYW * leftXie, -data.BKH, 0, sinA, cosA, data.BKH / H * leftQie);

            fontpath = [
                new Vector2(0, 0),
                new Vector2(fontp[2], 0),
                new Vector2(fontp[2] + data.BKH / H * leftQie, -data.BKH),
                new Vector2(0, -data.BKH)
            ]
            frontface = CommonUtils.getLeftXieFaceVI(ZYW, YYW, ZYL + leftXie, -data.BKH, 0, sinA, cosA, data.BKH / H * leftQie);

            bholes = [];
            kongpoint = [];

            let zysk = AModelFmulaUtils.getHolesbyExpress(data.p_zysk, backp[2], 2, data, AK.p_zysk);
            // filterNum = 0;
            for (i = 0; i < zysk.length; i++) {
                xv = zysk[i];
                yv = -(data.BKH - data.BKKJMDis);

                // if (xv > fontp[2] - data.BKDia / 2) {
                //     // filterNum++;
                //     continue;
                // }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                bholes.push(holePath);

                kongpoint.push(xv, yv, 0);
            }

            fholes = [];
            for (i = 0; i < zysk.length; i++) {
                xv = zysk[i] - backp[2] + fontp[2];
                yv = -(data.BKH - data.BKKJMDis);

                // if (zysk[i] > backp[2] - data.BKDia / 2) {
                //     continue;
                // }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                fholes.push(holePath);

            }

            // AModelFmulaUtils.getHolesbyExpress(data.p_zysk, ZYL + leftXie + leftQie, 2, data, AK.p_zysk, filterNum);

            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                kx = a * cosA + (ZYW) / sinA + (YYW) / sinA * cosA;
                ky = b;
                kz = a * sinA + (YYW);
                return [kx, ky, kz];
            });
            data.kongpoint.push(...kongpoint);

            if (BIM.simpleMold) {
                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, backpath, bholes, AK.p_zysk,
                    (a: number, b: number) => [a * cosA + (ZYW) / sinA + (YYW) / sinA * cosA, b, a * sinA + (YYW)]);

            }
            else {
                count = CommonUtils.getLeftHoleVI(count, vertices, indices, facevec, fholes, bholes, fontpath, backpath, backface,
                    frontface, ZYW, YYW, data.ZYYJXKH, sinA, cosA, AK.p_zysk);
            }


            // 右翼竖孔
            let bx = (ZYW - data.ZYYJXKH) / sinA + (YYW - data.ZYYJXKH) / sinA * cosA;
            let tx = ZYW / sinA + YYW / sinA * cosA;

            holes = [];
            kongpoint = [];
            let yysk = AModelFmulaUtils.getHolesbyExpress(data.p_yysk, YYL - tx + rightXie, 2, data, AK.p_yysk);
            // filterNum = 0;
            for (i = 0; i < yysk.length; i++) {
                xv = yysk[i] + tx;
                yv = -(data.BKH - data.BKKJMDis)

                // if (xv < tx + data.BKDia / 2) {
                //     // filterNum++;
                //     continue;
                // }
                // if (xv > YYL + rightXie + (data.BKH - data.BKKJMDis) / H * rightQie - data.BKDia / 2) {
                //     continue;
                // }

                holePath = new Path()
                    .moveTo(xv, yv)
                    .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);
                kongpoint.push(xv, yv, 0);
            }
            // AModelFmulaUtils.getHolesbyExpress(data.p_yysk, YYL + rightXie, 2, data, AK.p_yysk, filterNum);
            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                kx = a;
                ky = b;
                kz = YYW;
                return [kx, ky, kz];
            });
            data.kongpoint.push(...kongpoint);


            count = CommonUtils.getRightHoleVI(count, vertices, indices, facevec, holes, bx, tx, YYL + (ZYW - data.ZYYJXKH) / ZYW * rightXie,
                YYL + rightXie, -data.BKH, 0, YYW - data.ZYYJXKH, YYW, cosA, sinA, ZYW, YYW, AK.p_yysk, data.BKH / H * rightQie);
        }

        // 左封
        if (data.p_zfentype != XQType.none) {

            let sinC: number, cosB: number, cosC: number;
            let HC = CommonUtils.SqrtValue(leftQie, H);
            let WC = CommonUtils.SqrtValue(leftXie, ZYW);
            cosB = H / HC;
            sinC = leftXie / WC;
            cosC = ZYW / WC;

            if (data.p_zfentype === XQType.mf) {

                let mfh = H === 50 ? data.BKH + H : H;
                let mfw = iszywequal ? data.BKH + ZYW : ZYW;
                path = [
                    new Vector2(0, 0),
                    new Vector2(0, -mfh / cosB),
                    new Vector2(mfw / cosC, -mfh / cosB),
                    new Vector2(mfw / cosC, 0)
                ];

                backface = [
                    new Vector3(ZYL * cosA, 0, ZYL * sinA),
                    new Vector3((ZYL + leftQie) * cosA, -mfh, (ZYL + leftQie) * sinA),

                    new Vector3((ZYL + leftXie + leftQie) * cosA + mfw * sinA, -mfh, (ZYL + leftXie + leftQie) * sinA - mfw * cosA),
                    new Vector3((ZYL + leftXie) * cosA + mfw * sinA, 0, (ZYL + leftXie) * sinA - mfw * cosA)
                ];
                frontface = [
                    new Vector3((ZYL - data.ZYYFBH) * cosA, 0, (ZYL - data.ZYYFBH) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + leftQie) * cosA, -mfh, (ZYL - data.ZYYFBH + leftQie) * sinA),

                    new Vector3((ZYL - data.ZYYFBH + leftXie + leftQie) * cosA + mfw * sinA, -mfh, (ZYL - data.ZYYFBH + leftXie + leftQie) * sinA - mfw * cosA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie) * cosA + mfw * sinA, 0, (ZYL - data.ZYYFBH + leftXie) * sinA - mfw * cosA)
                ];

                holes = [];
                // count = CommonUtils.getFengVI(count, vertices, indices, facevec, ZYL, data.ZYYJXKH, cosA, sinA, backface, frontface, path, null);
            }
            else {

                path = H === 50 ? [
                    new Vector2(0, 0),
                    new Vector2(0, -data.BKH / cosB),
                    new Vector2(ZYW / cosC, -data.BKH / cosB),
                    new Vector2(ZYW / cosC, 0)
                ] : iszywequal ? [
                    new Vector2(0, 0),
                    new Vector2(0, -H / cosB),
                    new Vector2(data.BKH / cosC, -H / cosB),
                    new Vector2(data.BKH / cosC, 0)
                ] : [
                    new Vector2(0, 0),
                    new Vector2(0, -H / cosB),
                    new Vector2(data.BKH / cosC, -H / cosB),
                    new Vector2(data.BKH / cosC, -data.BKH / cosB),
                    new Vector2(ZYW / cosC, -data.BKH / cosB),
                    new Vector2(ZYW / cosC, 0)
                ];

                backface = H === 50 ? [
                    new Vector3(ZYL * cosA, 0, ZYL * sinA),
                    new Vector3((ZYL + leftQie) * cosA, -data.BKH, (ZYL + leftQie) * sinA),
                    new Vector3((ZYL + leftXie + data.BKH / H * leftQie) * cosA + ZYW * sinA, -data.BKH, (ZYL + leftXie + data.BKH / H * leftQie) * sinA - ZYW * cosA),
                    new Vector3((ZYL + leftXie) * cosA + ZYW * sinA, 0, (ZYL + leftXie) * sinA - ZYW * cosA)
                ] : iszywequal ? [
                    new Vector3(ZYL * cosA, 0, ZYL * sinA),
                    new Vector3((ZYL + leftQie) * cosA, -H, (ZYL + leftQie) * sinA),
                    new Vector3((ZYL + leftXie + data.BKH / H * leftQie) * cosA + (data.BKH) * sinA, -H, (ZYL + leftXie + data.BKH / H * leftQie) * sinA - (data.BKH) * cosA),
                    new Vector3((ZYL + leftXie) * cosA + (data.BKH) * sinA, 0, (ZYL + leftXie) * sinA - (data.BKH) * cosA)
                ] : [
                    new Vector3(ZYL * cosA, 0, ZYL * sinA),
                    new Vector3((ZYL + leftQie) * cosA, -H, (ZYL + leftQie) * sinA),
                    new Vector3((ZYL + data.BKH / ZYW * leftXie + leftQie) * cosA + data.BKH * sinA, -H, (ZYL + data.BKH / ZYW * leftXie + leftQie) * sinA - data.BKH * cosA),
                    new Vector3((ZYL + data.BKH / ZYW * leftXie + data.BKH / H * leftQie) * cosA + data.BKH * sinA, -data.BKH, (ZYL + data.BKH / ZYW * leftXie + data.BKH / H * leftQie) * sinA - data.BKH * cosA),
                    new Vector3((ZYL + leftXie + data.BKH / H * leftQie) * cosA + ZYW * sinA, -data.BKH, (ZYL + leftXie + data.BKH / H * leftQie) * sinA - ZYW * cosA),
                    new Vector3((ZYL + leftXie) * cosA + ZYW * sinA, 0, (ZYL + leftXie) * sinA - ZYW * cosA)
                ];
                frontface = H === 50 ? [
                    new Vector3((ZYL - data.ZYYFBH) * cosA, 0, (ZYL - data.ZYYFBH) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + leftQie) * cosA, -data.BKH, (ZYL - data.ZYYFBH + leftQie) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie + data.BKH / H * leftQie) * cosA + ZYW * sinA, -data.BKH, (ZYL - data.ZYYFBH + leftXie + data.BKH / H * leftQie) * sinA - ZYW * cosA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie) * cosA + ZYW * sinA, 0, (ZYL - data.ZYYFBH + leftXie) * sinA - ZYW * cosA)
                ] : iszywequal ? [
                    new Vector3((ZYL - data.ZYYFBH) * cosA, 0, (ZYL - data.ZYYFBH) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + leftQie) * cosA, -H, (ZYL - data.ZYYFBH + leftQie) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie + data.BKH / H * leftQie) * cosA + (data.BKH) * sinA, -H, (ZYL - data.ZYYFBH + leftXie + data.BKH / H * leftQie) * sinA - (data.BKH) * cosA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie) * cosA + (data.BKH) * sinA, 0, (ZYL - data.ZYYFBH + leftXie) * sinA - (data.BKH) * cosA)
                ] : [
                    new Vector3((ZYL - data.ZYYFBH) * cosA, 0, (ZYL - data.ZYYFBH) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + leftQie) * cosA, -H, (ZYL - data.ZYYFBH + leftQie) * sinA),
                    new Vector3((ZYL - data.ZYYFBH + data.BKH / ZYW * leftXie + leftQie) * cosA + data.BKH * sinA, -H, (ZYL - data.ZYYFBH + data.BKH / ZYW * leftXie + leftQie) * sinA - data.BKH * cosA),
                    new Vector3((ZYL - data.ZYYFBH + data.BKH / ZYW * leftXie + data.BKH / H * leftQie) * cosA + data.BKH * sinA, -data.BKH, (ZYL - data.ZYYFBH + data.BKH / ZYW * leftXie + data.BKH / H * leftQie) * sinA - data.BKH * cosA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie + data.BKH / H * leftQie) * cosA + ZYW * sinA, -data.BKH, (ZYL - data.ZYYFBH + leftXie + data.BKH / H * leftQie) * sinA - ZYW * cosA),
                    new Vector3((ZYL - data.ZYYFBH + leftXie) * cosA + ZYW * sinA, 0, (ZYL - data.ZYYFBH + leftXie) * sinA - ZYW * cosA)
                ];

                holes = [];

                let zzfenkw = AModelFmulaUtils.getHolesbyExpress(data.p_fbsk, H, 2, data, AK.p_fbsk);
                let zyfenkw = AModelFmulaUtils.getHolesbyExpress(data.p_zfenkw, ZYW, 2, data, AK.p_zfenkw);
                if (H == 100 && ZYW == 100) {

                    let zfone = new Vector2(zyfenkw[0], -(data.BKH - data.BKKJMDis));
                    let zftwo = new Vector2((data.BKH - data.BKKJMDis), -zzfenkw[0]);

                    holePath = CommonUtils.getCapsulePath(zfone, zftwo, data.BKDia / 2);
                    holes.push(holePath);
                }
                else {
                    // 封板平孔
                    if (!iszywequal) {
                        for (i = 0; i < zyfenkw.length; i++) {
                            xv = zyfenkw[i];
                            yv = -(data.BKH - data.BKKJMDis);

                            let inPolygon = CommonUtils.inPolygon(new Vector2(xv, yv), path, data.BKDia / 2);
                            if (inPolygon) {
                                inPolygon = CommonUtils.checkPointPolygon(path, new Vector2(xv, yv));
                            }
                            if (!inPolygon) {
                                continue;
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);
                        }
                    }

                    if (H !== 50) {
                        // 封板竖孔
                        for (i = 0; i < zzfenkw.length; i++) {
                            xv = (data.BKH - data.BKKJMDis);
                            yv = -zzfenkw[i];

                            let inPolygon = CommonUtils.inPolygon(new Vector2(xv, yv), path, data.BKDia / 2);
                            if (inPolygon) {
                                inPolygon = CommonUtils.checkPointPolygon(path, new Vector2(xv, yv));
                            }
                            if (!inPolygon) {
                                continue;
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);
                        }
                    }
                }
            }


            kongpoint = [];
            for (i = 0; i < holes.length; i++) {

                kongpoint.push((holes[i].curves[0] as any).aX, (holes[i].curves[0] as any).aY, 0);
            }

            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [
                a * cosC * sinA + (ZYL - b * cosB / H * leftQie) * cosA + a * cosC / ZYW * leftXie * cosA,
                b * cosB,
                -a * cosC * cosA + (ZYL - b * cosB / H * leftQie) * sinA + a * cosC / ZYW * leftXie * sinA
            ]);
            data.kongpoint.push(...kongpoint);

            let topvec = backface.concat(backface[0].clone());
            let bottomvec = frontface.concat(frontface[0].clone());

            if (!BIM.simpleMold) {
                // 侧边
                let side = CommonUtils.getSideVIF(bottomvec, topvec, count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, holes, "p_fbk",
                    (a: number, b: number) => [
                        a * cosC * sinA + (ZYL - data.ZYYFBH - b * cosB / H * leftQie) * cosA + a * cosC / ZYW * leftXie * cosA,
                        b * cosB,
                        -a * cosC * cosA + (ZYL - data.ZYYFBH - b * cosB / H * leftQie) * sinA + a * cosC / ZYW * leftXie * sinA
                    ]);
            }

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, holes, "p_fbk",
                (a: number, b: number) => [
                    a * cosC * sinA + (ZYL - b * cosB / H * leftQie) * cosA + a * cosC / ZYW * leftXie * cosA,
                    b * cosB,
                    -a * cosC * cosA + (ZYL - b * cosB / H * leftQie) * sinA + a * cosC / ZYW * leftXie * sinA
                ]);
        }

        // 右封
        if (data.p_yfentype != XQType.none) {

            let sinC: number, cosB: number, cosC: number;
            let HC = CommonUtils.SqrtValue(rightQie, H);
            let WC = CommonUtils.SqrtValue(rightXie, YYW);
            cosB = H / HC;
            sinC = rightXie / WC;
            cosC = YYW / WC;

            if (data.p_yfentype === XQType.mf) {
                let ymfh = H === 50 ? data.BKH + H : H;
                let ymfw = iszywequal ? data.BKH + YYW : YYW;
                path = [
                    new Vector2(0, 0),
                    new Vector2(0, ymfw / cosC),
                    new Vector2(-ymfh / cosB, ymfw / cosC),
                    new Vector2(-ymfh / cosB, 0)
                ];

                frontface = [
                    new Vector3(YYL, 0, 0),
                    new Vector3(YYL + rightXie, 0, ymfw),
                    new Vector3(YYL + rightXie + rightQie, -ymfh, ymfw),
                    new Vector3(YYL + rightQie, -ymfh, 0)
                ];

                backface = [
                    new Vector3(YYL - data.ZYYFBH, 0, 0),
                    new Vector3(YYL - data.ZYYFBH + rightXie, 0, ymfw),
                    new Vector3(YYL - data.ZYYFBH + rightXie + rightQie, -ymfh, ymfw),
                    new Vector3(YYL - data.ZYYFBH + rightQie, -ymfh, 0)
                ]

                holes = [];
                // count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 1, YYL, YYL - data.ZYYJXKH, true);
            }
            else {

                let yzfenkw = AModelFmulaUtils.getHolesbyExpress(data.p_fbsk, H, 2, data, AK.p_fbsk);
                let yyfenkw = AModelFmulaUtils.getHolesbyExpress(data.p_yfenkw, YYW, 2, data, AK.p_yfenkw);


                path = H === 50 ? [
                    new Vector2(0, 0),
                    new Vector2(0, YYW / cosC),
                    new Vector2(-data.BKH / cosB, YYW / cosC),
                    new Vector2(-data.BKH / cosB, 0)
                ] : iszywequal ? [
                    new Vector2(0, 0),
                    new Vector2(0, data.BKH / cosC),
                    new Vector2(-H / cosB, data.BKH / cosC),
                    new Vector2(-H / cosB, 0)
                ] : [
                    new Vector2(0, 0),
                    new Vector2(0, YYW / cosC),
                    new Vector2(-data.BKH / cosB, YYW / cosC),
                    new Vector2(-data.BKH / cosB, data.BKH / cosC),
                    new Vector2(-H / cosB, data.BKH / cosC),
                    new Vector2(-H / cosB, 0)
                ];


                frontface = H === 50 ? [
                    new Vector3(YYL, 0, 0),
                    new Vector3(YYL, 0, YYW),
                    new Vector3(YYL, -data.BKH, YYW),
                    new Vector3(YYL, -data.BKH, 0)
                ] : iszywequal ? [
                    new Vector3(YYL, 0, 0),
                    new Vector3(YYL, 0, data.BKH),
                    new Vector3(YYL, -H, data.BKH),
                    new Vector3(YYL, -H, 0)
                ] : [
                    new Vector3(YYL, 0, 0),
                    new Vector3(YYL + rightXie, 0, YYW),
                    new Vector3(YYL + rightXie + data.BKH / H * rightQie, -data.BKH, YYW),
                    new Vector3(YYL + data.BKH / YYW * rightXie + data.BKH / H * rightQie, -data.BKH, data.BKH),
                    new Vector3(YYL + data.BKH / YYW * rightXie + rightQie, -H, data.BKH),
                    new Vector3(YYL + rightQie, -H, 0)
                ];

                backface = H === 50 ? [
                    new Vector3(YYL - data.ZYYFBH, 0, 0),
                    new Vector3(YYL - data.ZYYFBH, 0, YYW),
                    new Vector3(YYL - data.ZYYFBH, -data.BKH, YYW),
                    new Vector3(YYL - data.ZYYFBH, -data.BKH, 0)
                ] : iszywequal ? [
                    new Vector3(YYL - data.ZYYFBH, 0, 0),
                    new Vector3(YYL - data.ZYYFBH, 0, data.BKH),
                    new Vector3(YYL - data.ZYYFBH, -H, data.BKH),
                    new Vector3(YYL - data.ZYYFBH, -H, 0)
                ] : [
                    new Vector3(YYL - data.ZYYFBH, 0, 0),
                    new Vector3(YYL - data.ZYYFBH + rightXie, 0, YYW),
                    new Vector3(YYL - data.ZYYFBH + rightXie + data.BKH / H * rightQie, -data.BKH, YYW),
                    new Vector3(YYL - data.ZYYFBH + data.BKH / YYW * rightXie + data.BKH / H * rightQie, -data.BKH, data.BKH),
                    new Vector3(YYL - data.ZYYFBH + data.BKH / YYW * rightXie + rightQie, -H, data.BKH),
                    new Vector3(YYL - data.ZYYFBH + rightQie, -H, 0)
                ]

                holes = [];


                kongpoint = []
                if (YYW == 100 && H == 100) {

                    let yfone = new Vector2(-(data.BKH - data.BKKJMDis), yyfenkw[0]);
                    let yftwo = new Vector2(-yzfenkw[0], (data.BKH - data.BKKJMDis));

                    holePath = CommonUtils.getCapsulePath(yfone, yftwo, data.BKDia / 2);
                    holes.push(holePath);

                }
                else {


                    if (!iszywequal) {
                        // 封板平孔
                        for (i = 0; i < yyfenkw.length; i++) {
                            xv = -(data.BKH - data.BKKJMDis);
                            yv = yyfenkw[i];

                            let inPolygon = CommonUtils.inPolygon(new Vector2(xv, yv), path, data.BKDia / 2);
                            if (inPolygon) {
                                inPolygon = CommonUtils.checkPointPolygon(path, new Vector2(xv, yv));
                            }
                            if (!inPolygon) {
                                continue;
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);
                        }
                    }

                    if (H !== 50) {
                        // 封板竖孔
                        for (i = 0; i < yzfenkw.length; i++) {
                            xv = -yzfenkw[i];
                            yv = (data.BKH - data.BKKJMDis);


                            let inPolygon = CommonUtils.inPolygon(new Vector2(xv, yv), path, data.BKDia / 2);
                            if (inPolygon) {
                                inPolygon = CommonUtils.checkPointPolygon(path, new Vector2(xv, yv));
                            }
                            if (!inPolygon) {
                                continue;
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);
                        }
                    }

                }
            }


            kongpoint = [];
            for (i = 0; i < holes.length; i++) {

                kongpoint.push((holes[i].curves[0] as any).aX, (holes[i].curves[0] as any).aY, 0);
            }

            CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [
                YYL + b * sinC + Math.abs(a * cosB / H) * rightQie, a * cosB, b * cosC
            ]);
            data.kongpoint.push(...kongpoint);

            let topvec = backface.concat(backface[0].clone());
            let bottomvec = frontface.concat(frontface[0].clone());
            if (!BIM.simpleMold) {
                // 侧边
                let side = CommonUtils.getSideVIF(bottomvec, topvec, count);
                vertices.push(...side[0]);
                indices.push(...side[1]);
                facevec.push(...side[2]);
                count = side[3];

                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, backface, path, holes, "p_fbk",
                    (a: number, b: number) => [YYL - data.ZYYFBH + b * sinC + Math.abs(a * cosB / H) * rightQie, a * cosB, b * cosC]);
            }

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, frontface, path, holes, "p_fbk",
                (a: number, b: number) => [YYL + b * sinC + Math.abs(a * cosB / H) * rightQie, a * cosB, b * cosC]);
        }

        return [vertices, indices, facevec];
    }

    /**
     * 获取光面的路径
     * @param W 
     * @param L 
     * @param QKW 
     * @param QKH 
     * @param p_lpck 
     * @param p_lpch 
     * @param lpcdw 
     * @param isLeft 是否是左侧
     * @param qkdw 缺口定位
     * @returns 
     */
    static getGMTGapVI(W: number, L: number, QKW: number, QKH: number,
        p_lpck: number, p_lpch: number, lpcdw: number[], isLeft: boolean, qkdw: string) {

        let gmt = [
            [0, 0],
            [W, 0],
            [W, L],
            [0, L],
            [0, 0]
        ];

        let result: any[] = gmt.concat();

        let poly = polygon([gmt]);

        // 缺口
        let i: number;
        let diff: any;
        let dd: any;
        let posAry = [];
        let qkpoly: any;
        let qkpos: number = 0;
        let qkPathVec: number[][];
        let qkdwAry: any[];

        if (QKH > 0 && QKW > 0) {
            qkdwAry = CommonUtils.getQKAry(qkdw, L);
            if (qkdwAry.length > 0) {
                for (i = 0; i < qkdwAry.length; i++) {
                    qkpos += Number(qkdwAry[i]);
                    posAry.push([qkpos - QKW / 2, qkpos + QKW / 2])
                    if (qkpos > 0) {
                        qkPathVec = isLeft ? [
                            [W, qkpos + QKW / 2],
                            [W, qkpos - QKW / 2],
                            [W - QKH, qkpos - QKW / 2],
                            [W - QKH, qkpos + QKW / 2],

                            [W, qkpos + QKW / 2]
                        ] : [
                            [0, qkpos + QKW / 2],
                            [0, qkpos - QKW / 2],
                            [QKH, qkpos - QKW / 2],
                            [QKH, qkpos + QKW / 2],

                            [0, qkpos + QKW / 2]
                        ]

                        qkpoly = polygon([qkPathVec]);
                        diff = difference(poly, qkpoly);
                        dd = diff.geometry.coordinates;
                        if (dd.length > 1) {
                            dd = dd[0][0].length > dd[1][0].length ? dd[0] : dd[1];
                        }
                        poly = polygon(dd);
                    }
                }
            }
        }

        // 左
        let lpcpos: number = 0;
        let lpcpoly: any;
        let lpcPathVec: any[]
        if (lpcdw.length > 0) {
            for (i = 0; i < lpcdw.length; i++) {
                lpcpos = Number(lpcdw[i]);
                if (lpcpos > 0 && CommonUtils.pathxj(lpcpos - p_lpck / 2, lpcpos + p_lpck / 2, posAry)) {
                    lpcPathVec = isLeft ? [
                        [W, lpcpos + p_lpck / 2],
                        [W, lpcpos - p_lpck / 2],
                        [W - p_lpch, lpcpos - p_lpck / 2],
                        [W - p_lpch, lpcpos + p_lpck / 2],

                        [W, lpcpos + p_lpck / 2]
                    ] : [
                        [0, lpcpos + p_lpck / 2],
                        [0, lpcpos - p_lpck / 2],
                        [p_lpch, lpcpos - p_lpck / 2],
                        [p_lpch, lpcpos + p_lpck / 2],

                        [0, lpcpos + p_lpck / 2]
                    ]

                    lpcpoly = polygon([lpcPathVec]);
                    diff = difference(poly, lpcpoly);
                    dd = diff.geometry.coordinates;
                    if (dd.length > 1) {
                        dd = dd[0][0].length > dd[1][0].length ? dd[0] : dd[1];
                    }
                    poly = polygon(dd);
                }
            }
        }

        if (diff) {
            result = dd[0].concat();
        }

        let pathVec: Vector2[] = [];
        for (let i = 0; i < result.length; i++) {
            pathVec.push(new Vector2(result[i][0], result[i][1]));
        }

        return pathVec;
    }

    static getECYiChaiVI(count: number, vertices: any[], indices: any[], facevec: any[], data: any, L: number,
        W: number, WC: number, XQNXJL: number, BKH: number, SXKH: number, len: number, zxval: number, yxval: number, isLeft: boolean): number {

        let cosB = W / WC;
        let sinB = XQNXJL / WC;
        let path = [
            new Vector2(0, 0),
            new Vector2(0 + zxval, BKH),
            new Vector2(WC + yxval, BKH),
            new Vector2(WC, 0)
        ]


        let skkw = AModelFmulaUtils.getHolesbyExpress(data['Csxbkk'], W, 2, data);
        let holes = [];

        for (let i = 0; i < skkw.length; i++) {
            let xv = skkw[i];
            let yv = BKH - data.BKKJMDis;

            if (!CommonUtils.checkHoleInFace(new Vector2(xv, yv), path)) {
                continue;
            }

            let holePath = new Path()
                .moveTo(xv, yv)
                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }

        let i: number, tpy: number, bpy: number, yv: number;
        let top: Vector3, bottom: Vector3;
        let topface = [];
        let bottomface = [];
        for (i = 0; i < path.length; i++) {

            tpy = isLeft ? len + path[i].x * sinB : len - path[i].x * sinB;
            top = new Vector3(path[i].x * cosB, tpy, path[i].y);

            bpy = isLeft ? len - SXKH + path[i].x * sinB : len - SXKH - path[i].x * sinB;
            bottom = new Vector3(path[i].x * cosB, bpy, path[i].y);

            topface.push(top);
            bottomface.push(bottom);
        }

        let topvec = topface.concat(topface[0].clone());
        let bottomvec = bottomface.concat(bottomface[0].clone());

        let side: any[];
        if (!BIM.simpleMold) {
            // 侧边
            side = CommonUtils.getSideVIF(bottomvec, topvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        topface = [];
        bottomface = [];
        for (i = 0; i < path.length; i++) {

            tpy = isLeft ? len + path[i].x * sinB : len - path[i].x * sinB;
            top = new Vector3(path[i].x * cosB, tpy, path[i].y);

            bpy = isLeft ? len + SXKH + path[i].x * sinB : len + SXKH - path[i].x * sinB;
            bottom = new Vector3(path[i].x * cosB, bpy, path[i].y);

            topface.push(top);
            bottomface.push(bottom);
        }

        topvec = topface.concat(topface[0].clone());
        bottomvec = bottomface.concat(bottomface[0].clone());

        // 侧边
        if (!BIM.simpleMold) {
            side = CommonUtils.getSideVIF(topvec, bottomvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, holes, null, (a, b) => {
            yv = isLeft ? len + a * sinB : len - a * sinB;
            return [a * cosB, yv, b];
        })

        // 顶点
        if (!BIM.simpleMold) {

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, holes, null, (a, b) => {
                yv = isLeft ? len - SXKH + a * sinB : len - SXKH - a * sinB;
                return [a * cosB, yv, b];
            });

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, path, holes, null, (a, b) => {
                yv = isLeft ? len + SXKH + a * sinB : len + SXKH - a * sinB;
                return [a * cosB, yv, b];
            });
        }

        return count;
    }



    static getECPlateRightGapPath(L: number, W: number, QKH: number, QKW: number, p_lpck: number,
        len: number, ykqkdw: string, p_yklpcdw: number[], kw: number[] = null) {

        let frontPath: number[][];
        frontPath = [
            [0, 0],
            [0, len],
            [L, len],
            [L, 0],
            [0, 0]
        ];


        let frontpoly = polygon([frontPath]);

        let i: number, j: number;
        let fpathVec: number[][];
        let fdiff: any;

        let fisone = false;

        let fresult: any[] = [];

        let righttpos: number = 0;

        let yposAry = []; //缺口范围
        let ylpfAry = [];

        // 缺口
        if (QKH > 0 && QKW > 0) {
            let ykqkdwAry = CommonUtils.getQKAry(ykqkdw, L);
            if (ykqkdwAry.length > 0) {
                for (i = 0; i < ykqkdwAry.length; i++) {
                    righttpos += Number(ykqkdwAry[i]);
                    yposAry.push([righttpos - QKW / 2, righttpos + QKW / 2]);
                    if (righttpos > 0) {

                        let walltp = righttpos + QKW / 2;
                        let wallbp = righttpos - QKW / 2;

                        fpathVec = [
                            [wallbp, 0],
                            [wallbp, len],
                            [walltp, len],
                            [walltp, 0],
                            [wallbp, 0]
                        ]


                        let tpoly = polygon([fpathVec]);

                        let fg = difference(frontpoly, tpoly);
                        fdiff = fg.geometry.coordinates;

                        if (fdiff && fdiff.length > 0) {
                            fisone = fdiff.length === 1;
                            if (fisone) {

                                frontpoly = polygon(fdiff)
                            }
                            else {
                                fresult = fresult.concat(fdiff[0]);
                            }

                            if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                        }


                    }
                }

                fresult = fresult.concat(frontpoly.geometry.coordinates);
            }
        }

        if (p_yklpcdw.length > 0) {
            for (i = 0; i < p_yklpcdw.length; i++) {
                righttpos = Number(p_yklpcdw[i]);

                if (righttpos > 0 && CommonUtils.pathxj(righttpos - p_lpck / 2, righttpos + p_lpck / 2, yposAry)) {

                    let walltp = righttpos + p_lpck / 2;
                    let wallbp = righttpos - p_lpck / 2;

                    fpathVec = [
                        [wallbp, 0],
                        [wallbp, len],
                        [walltp, len],
                        [walltp, 0],
                        [wallbp, 0]
                    ]


                    let tpoly = polygon([fpathVec]);

                    let fg = difference(frontpoly, tpoly);
                    fdiff = fg.geometry.coordinates;

                    if (fdiff && fdiff.length > 0) {
                        fisone = fdiff.length === 1;
                        if (fisone) {

                            frontpoly = polygon(fdiff)
                        }
                        else {
                            fresult = fresult.concat(fdiff[0]);
                        }

                        if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                    }

                    ylpfAry.push(fpathVec); //路径

                    if (kw) kw.push(righttpos); // 孔位
                }
            }

            fresult = fresult.concat(frontpoly.geometry.coordinates);
        }

        let ftarget: any[] = [];
        let foneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            foneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                foneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            ftarget.push(foneVec);
        }


        let flp: any[] = [];
        if (ylpfAry.length > 0) {
            for (i = 0; i < ylpfAry.length; i++) {
                foneVec = [];
                for (j = 0; j < ylpfAry[i].length; j++) {
                    foneVec.push(new Vector2(ylpfAry[i][j][0], ylpfAry[i][j][1]));
                }
                flp.push(foneVec);
            }
        }

        return { front: ftarget, frontlp: flp };
    }



    static getECPlateLeftBKVI(count: number, vertices: number[], indices: number[], facevec: any[],
        fone: Vector2[], bone: Vector2[], holes: Path[], ZYKH: number,
        adv: number, ra: number, kongtype: string, ox: number = 0, isLptx: boolean = false): number {

        let topface: Vector3[] = [];
        let bottomface: Vector3[] = [];

        let top: Vector3, bottom: Vector3;
        for (let i = 0; i < fone.length; i++) {

            top = new Vector3(ox + fone[i].y * adv, fone[i].x, fone[i].y * ra);
            bottom = new Vector3(ZYKH + bone[i].y * adv, bone[i].x, bone[i].y * ra);

            topface.push(top);
            bottomface.push(bottom);
        }

        let topvec = topface.concat();
        let bottomvec = bottomface.concat();
        if (!BIM.simpleMold) {
            // 侧边
            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        // 前后面
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, fone, holes, kongtype,
            (a: number, b: number) => [ox + b * adv, a, b * ra]);

        if (!BIM.simpleMold) {

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, bone, holes, kongtype,
                (a: number, b: number) => [ZYKH + b * adv, a, b * ra]);
        }

        // 如果是拉片体系    
        if (isLptx && BIM.simpleMold) {
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                topface[0],
                new Vector3(topface[0].x - ox, topface[0].y, topface[0].z),
                new Vector3(topface[1].x - ox, topface[1].y, topface[1].z),
                topface[1]
            ], [
                new Vector2(topface[0].x, topface[0].z),
                new Vector2(topface[0].x - ox, topface[0].z),
                new Vector2(topface[1].x - ox, topface[1].z),
                new Vector2(topface[1].x, topface[1].z)
            ], null, null, (x, y) => [x, topface[0].y, y])


            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                topface[3],
                new Vector3(topface[3].x - ox, topface[3].y, topface[3].z),
                new Vector3(topface[2].x - ox, topface[2].y, topface[2].z),
                topface[2]
            ], [
                new Vector2(topface[3].x, topface[3].z),
                new Vector2(topface[3].x - ox, topface[3].z),
                new Vector2(topface[2].x - ox, topface[2].z),
                new Vector2(topface[2].x, topface[2].z)
            ], null, null, (x, y) => [x, topface[2].y, y])
        }

        return count;
    }


    static getECPlateRightBKVI(count: number, vertices: number[], indices: number[], facevec: any[],
        fone: Vector2[], bone: Vector2[], holes: Path[], W: number, ZYKH: number,
        adv: number, ra: number, kongtype: string, ox: number = 0, islptx: boolean = false): number {

        let topface: Vector3[] = [];
        let bottomface: Vector3[] = [];

        let top: Vector3, bottom: Vector3;
        for (let i = 0; i < fone.length; i++) {

            top = new Vector3(W + fone[i].y * adv - ox, fone[i].x, fone[i].y * ra);
            bottom = new Vector3(W - ZYKH + bone[i].y * adv, bone[i].x, bone[i].y * ra);

            topface.push(top);
            bottomface.push(bottom);
        }

        let topvec = topface.concat();
        let bottomvec = bottomface.concat();
        if (!BIM.simpleMold) {
            // 侧边
            let side = CommonUtils.getSideVIF(topvec, bottomvec, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        // 前后面
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, topface, fone, holes, kongtype,
            (a: number, b: number) => [W - ox + b * adv, a, b * ra]);

        if (!BIM.simpleMold) {

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, bottomface, bone, holes, kongtype,
                (a: number, b: number) => [W - ZYKH + b * adv, a, b * ra]);
        }

        // 如果是拉片体系    
        if (islptx && BIM.simpleMold) {
            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                topface[0],
                new Vector3(topface[0].x + ox, topface[0].y, topface[0].z),
                new Vector3(topface[1].x + ox, topface[1].y, topface[1].z),
                topface[1]
            ], [
                new Vector2(topface[0].x, topface[0].z),
                new Vector2(topface[0].x + ox, topface[0].z),
                new Vector2(topface[1].x + ox, topface[1].z),
                new Vector2(topface[1].x, topface[1].z)
            ], null, null, (x, y) => [x, topface[0].y, y])


            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [
                topface[3],
                new Vector3(topface[3].x + ox, topface[3].y, topface[3].z),
                new Vector3(topface[2].x + ox, topface[2].y, topface[2].z),
                topface[2]
            ], [
                new Vector2(topface[3].x, topface[3].z),
                new Vector2(topface[3].x + ox, topface[3].z),
                new Vector2(topface[2].x + ox, topface[2].z),
                new Vector2(topface[2].x, topface[2].z)
            ], null, null, (x, y) => [x, topface[2].y, y])
        }

        return count;
    }


    /** 获取EC板数据 */
    static getECSlotVI(data: ALParams): any[] {

        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        // 参数
        let L: number = +data.L;
        let W: number = +data.W;
        let H: number = +data.H;

        // 光面厚度
        let GMT: number = +data.GMT;

        // 拉片槽
        let p_lpck: number = +data.p_lpck;
        let p_lpch: number = +data.p_lpch;
        let p_zklpcdw = data.p_zklpcdw;
        let p_yklpcdw = data.p_yklpcdw;

        // 缺口
        let p_qkh: number = +data.p_qkh;
        let p_qkw: number = +data.p_qkw;
        let p_zkqkdw = data.p_zkqkdw;
        let p_ykqkdw = data.p_ykqkdw;

        // 边框
        let BKKJMDis: number = +data.BKKJMDis;
        let BKDia: number = +data.BKDia;
        let BKH: number = +data.BKH;
        let SXKH: number = +data.SXKH;
        let ZYKH: number = +data.ZYKH;
        let XBNXJD: number = +data.XBNXJD;
        let p_skkw = data.p_skkw;
        let p_xkkw = data.p_xkkw;
        let p_zkkw = data.p_zkkw;
        let p_ykkw = data.p_ykkw;
        let p_sksctype = data.p_syfentype;
        let p_xksctype = data.p_xzfentype;
        let p_zksctype = data.p_zksctype;
        let p_yksctype = data.p_yksctype;

        // 易拆
        let YCJL: number = +data.YCJL;
        let p_yctype = data.p_yctype;

        // L位置
        let p_ecplateLtype = +data.p_ecplateLtype;

        // 内外斜
        let radian = XBNXJD / 180 * Math.PI;
        let cosA = Math.cos(radian);
        let sinA = Math.sin(radian);
        let tanA = Math.tan(radian);

        // 光面斜值
        let gmtxie = GMT / tanA;
        let bkxie = BKH / tanA;


        // 端点
        data.duan = [
            0, 0, 0,
            W, 0, 0,
            W, L, 0,
            0, L, 0
        ];
        // 拉伸点
        data.zhong = {
            L: [
                {
                    pointer: [W / 2, L, 0],
                    center: [W / 2, L / 2, 0]

                },
            ],
            RL: [
                {
                    pointer: [W / 2, 0, 0],
                    center: [W / 2, L / 2, 0]

                },

            ],

            W: [
                {
                    pointer: [W, L / 2, 0],
                    center: [W / 2, L / 2, 0]
                }
            ],

            RW: [
                {
                    pointer: [0, L / 2, 0],
                    center: [W / 2, L / 2, 0]
                }
            ]
        }

        // 边框孔点
        data.kongpoint = [];

        // 拉片槽定位
        let zklpcdwAry = AModelFmulaUtils.getHolesbyExpress(p_zklpcdw, L, 2, data, AK.p_zklpcdw);
        let yklpcdwAry = AModelFmulaUtils.getHolesbyExpress(p_yklpcdw, L, 2, data, AK.p_yklpcdw);

        //1. 光面 受到缺口的影响
        let gmpath: Vector2[];
        if (p_ecplateLtype === 1) {
            // 右侧
            gmpath = SlotUtils.getGMTGapVI(W, L, p_qkw, p_qkh, p_lpck, p_lpch, zklpcdwAry, false, p_zkqkdw);
        }
        else {
            // 左侧
            gmpath = SlotUtils.getGMTGapVI(W, L, p_qkw, p_qkh, p_lpck, p_lpch, yklpcdwAry, true, p_ykqkdw);
        }
        gmpath.pop();

        let holes = [];

        data.p_r1 = CommonUtils.checkRadiusIsLegal(data.p_r1);
        data.p_r2 = CommonUtils.checkRadiusIsLegal(data.p_r2);
        data.p_r3 = CommonUtils.checkRadiusIsLegal(data.p_r3);

        data.p_r1dw = CommonUtils.fliterOuterPoint(data.p_r1dw, gmpath, false, false, false, true, data.p_r1.toString());
        data.p_r2dw = CommonUtils.fliterOuterPoint(data.p_r2dw, gmpath, false, false, false, true, data.p_r2.toString());
        data.p_r3dw = CommonUtils.fliterOuterPoint(data.p_r3dw, gmpath, false, false, false, true, data.p_r3.toString());

        CommonUtils.getGmtHoles(data.p_r1, data.p_r1dw, holes);
        CommonUtils.getGmtHoles(data.p_r2, data.p_r2dw, holes);
        CommonUtils.getGmtHoles(data.p_r3, data.p_r3dw, holes);

        // 添加光面孔位
        CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint);

        let i: number;
        if (BIM.simpleMold) {

            let gmface = [];
            for (i = 0; i < gmpath.length; i++) {
                gmface.push(new Vector3(gmpath[i].x, gmpath[i].y, 0));
            }

            count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, gmface, gmpath, holes, AK.p_r1dw,
                (a: number, b: number) => [a, b, 0]);
        }
        else {
            count = CommonUtils.getShapeVI(count, vertices, indices, facevec, gmpath, holes, 0, GMT, 0, true, AK.p_r1dw);
        }


        let zkkpos = AModelFmulaUtils.getHolesbyExpress(p_zkkw, L, 2, data, AK.p_zkkw);
        let ykkpos = AModelFmulaUtils.getHolesbyExpress(p_ykkw, L, 2, data, AK.p_ykkw);

        data.lpcdw = [];
        //左边框
        let kongpoint: any[];
        let xv: number, yv: number;
        let holePath: Path;
        let path: Vector2[];

        let zbklen = p_zksctype === XQType.normal ? BKH : BKH / sinA;

        if (p_ecplateLtype === 1) {

            let zbkpv = SlotUtils.getECPlateRightGapPath(L, W, p_qkh, p_qkw, p_lpck, zbklen, p_zkqkdw, zklpcdwAry);
            let zbkqkvec = [zbkpv.front, zbkpv.frontlp];
            if (CommonUtils.haveData(zbkqkvec) && p_qkh < W) {

                for (i = 0; i < zbkqkvec[0].length; i++) {

                    let fone = zbkqkvec[0][i].concat();
                    let minvecx = CommonUtils.getVectorMinX(fone, fone);

                    holes = [];
                    kongpoint = [];
                    for (let j = 0; j < zkkpos.length; j++) {
                        xv = zkkpos[j];
                        yv = BKH - BKKJMDis;

                        if (xv > minvecx[0] - BKDia / 2 || xv < minvecx[1] + BKDia / 2) {
                            continue;
                        }

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                        holes.push(holePath);

                        kongpoint.push(0, xv, yv);
                    }

                    let kadv = p_zksctype === XQType.nx ? cosA : p_zksctype === XQType.wx ? -cosA : 0;
                    let kra = p_zksctype === XQType.normal ? 1 : sinA;

                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {


                        let kx = 0 + c * kadv;
                        let ky = b;
                        let kz = c * kra

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = SlotUtils.getECPlateLeftBKVI(count, vertices, indices, facevec, fone, fone, holes, ZYKH, kadv, kra, AK.p_zkkw);

                }

                for (i = 0; i < zbkqkvec[1].length; i++) {

                    let fone = zbkqkvec[1][i].concat();


                    let minvecx = CommonUtils.getVectorMinX(fone, fone);

                    holes = [];
                    kongpoint = [];
                    for (let j = 0; j < zkkpos.length; j++) {
                        xv = zkkpos[j];
                        yv = BKH - BKKJMDis;

                        if (xv > minvecx[0] - BKDia / 2 || xv < minvecx[1] + BKDia / 2) {
                            continue;
                        }

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                        holes.push(holePath);

                        kongpoint.push(0, xv, yv);
                    }

                    let kadv = p_zksctype === XQType.nx ? cosA : p_zksctype === XQType.wx ? -cosA : 0;
                    let kra = p_zksctype === XQType.normal ? 1 : sinA;

                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {


                        let kx = c * kadv + p_lpch;
                        let ky = b;
                        let kz = c * kra

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = SlotUtils.getECPlateLeftBKVI(count, vertices, indices, facevec, fone, fone, holes, ZYKH, kadv, kra, AK.p_zkkw, p_lpch, true);


                    // 拉片槽定位
                    kongpoint = [];
                    for (let j = 0; j < zklpcdwAry.length; j++) {
                        xv = zklpcdwAry[j];
                        yv = BKH - BKKJMDis;

                        if (xv > minvecx[0] - BKDia / 2 || xv < minvecx[1] + BKDia / 2) {
                            continue;
                        }

                        kongpoint.push(0, xv, yv);
                    }

                    kadv = p_zksctype === XQType.nx ? cosA : p_zksctype === XQType.wx ? -cosA : 0;
                    kra = p_zksctype === XQType.normal ? 1 : sinA;

                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {


                        let kx = c * kadv + p_lpch;
                        let ky = b;
                        let kz = c * kra

                        return [kx, ky, kz];
                    });

                    data.lpcdw.push({ key: AK.p_zklpcdw, dw: [...kongpoint], dir: [-1, 0, 0] })
                }

            }
            else {
                let frontPath = [
                    new Vector2(0, 0),
                    new Vector2(0, zbklen),
                    new Vector2(L, zbklen),
                    new Vector2(L, 0)
                ]

                let backPath = [
                    new Vector2(0, 0),
                    new Vector2(0, zbklen),
                    new Vector2(L, zbklen),
                    new Vector2(L, 0)
                ];

                holes = [];
                kongpoint = [];
                for (i = 0; i < zkkpos.length; i++) {
                    xv = zkkpos[i];
                    yv = BKH - BKKJMDis;

                    let holePath = new Path();
                    holePath.moveTo(xv, yv)
                        .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(0, xv, yv);
                }

                if (p_zksctype === XQType.normal) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        return [0, b, c];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = CommonUtils.getFaceByPaths(count, vertices, indices, facevec, backPath, frontPath, holes, 1, 0, data.ZYKH, false, AK.p_zkkw);
                }
                else if (p_zksctype === XQType.nx) {
                    // 内斜
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                        return [c * cosA, b, c * sinA];
                    });
                    data.kongpoint.push(...kongpoint);
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 1, 1, ZYKH, 0, false, AK.p_zkkw)
                }
                else if (p_zksctype === XQType.wx) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        return [c * -cosA, b, c * sinA];
                    });
                    data.kongpoint.push(...kongpoint);
                    // 外斜
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 0, 1, ZYKH, 0, false, AK.p_zkkw)
                }
            }
        }
        else {
            holes = [];
            kongpoint = [];

            for (i = 0; i < zkkpos.length; i++) {
                xv = zkkpos[i];
                yv = H - BKKJMDis;

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(0, xv, yv);
            }

            data.kongpoint.push(...kongpoint);

            path = [
                new Vector2(0, 0),
                new Vector2(L, 0),
                new Vector2(L, H),
                new Vector2(0, H)
            ]

            if (BIM.simpleMold) {
                let zkface = [];
                for (i = 0; i < path.length; i++) {
                    zkface.push(new Vector3(0, path[i].x, path[i].y));
                }

                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, zkface, path, holes, AK.p_zkkw,
                    (a: number, b: number) => [0, a, b]);
            }
            else {
                count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, ZYKH, 0, true, AK.p_zkkw);
            }
        }

        // 右边框
        let ybklen = p_yksctype === XQType.normal ? BKH : BKH / sinA;

        if (p_ecplateLtype === 1) {
            holes = [];
            kongpoint = [];

            for (i = 0; i < ykkpos.length; i++) {
                xv = ykkpos[i];
                yv = H - BKKJMDis;

                holePath = new Path();
                holePath.moveTo(xv, yv)
                    .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                holes.push(holePath);

                kongpoint.push(W, xv, yv);
            }

            data.kongpoint.push(...kongpoint);

            path = [
                new Vector2(0, 0),
                new Vector2(L, 0),
                new Vector2(L, H),
                new Vector2(0, H)
            ]

            if (BIM.simpleMold) {
                let ykface = [];
                for (i = 0; i < path.length; i++) {
                    ykface.push(new Vector3(0, path[i].x, path[i].y));
                }

                count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, ykface, path, holes, AK.p_ykkw,
                    (a: number, b: number) => [W, a, b]);
            }
            else {
                count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 1, W, W - ZYKH, true, AK.p_ykkw);
            }
        }
        else {

            let ybkpv = SlotUtils.getECPlateRightGapPath(L, W, p_qkh, p_qkw, p_lpck, ybklen, p_ykqkdw, yklpcdwAry);
            let ybkqkvec = [ybkpv.front, ybkpv.frontlp];
            if (CommonUtils.haveData(ybkqkvec) && p_qkh < W) {

                for (i = 0; i < ybkqkvec[0].length; i++) {

                    let fone = ybkqkvec[0][i].concat();
                    let bone = ybkqkvec[0][i].concat();

                    let minvecx = CommonUtils.getVectorMinX(fone, bone);

                    holes = [];
                    kongpoint = [];
                    for (let j = 0; j < ykkpos.length; j++) {
                        xv = ykkpos[j];
                        yv = BKH - BKKJMDis;

                        if (xv > minvecx[0] - BKDia / 2 || xv < minvecx[1] + BKDia / 2) {
                            continue;
                        }

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                        holes.push(holePath);

                        kongpoint.push(0, xv, yv);
                    }

                    let kadv = p_yksctype === XQType.nx ? -cosA : p_yksctype === XQType.wx ? cosA : 0;
                    let kra = p_yksctype === XQType.normal ? 1 : sinA;

                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {


                        let kx = W + c * kadv;
                        let ky = b;
                        let kz = c * kra

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = SlotUtils.getECPlateRightBKVI(count, vertices, indices, facevec, fone, bone, holes, W, ZYKH, kadv, kra, AK.p_ykkw);

                }

                for (i = 0; i < ybkqkvec[1].length; i++) {

                    let fone = ybkqkvec[1][i].concat();
                    let bone = ybkqkvec[1][i].concat();

                    let minvecx = CommonUtils.getVectorMinX(fone, bone);

                    holes = [];
                    kongpoint = [];
                    for (let j = 0; j < ykkpos.length; j++) {
                        xv = ykkpos[j];
                        yv = BKH - BKKJMDis;

                        if (xv > minvecx[0] - BKDia / 2 || xv < minvecx[1] + BKDia / 2) {
                            continue;
                        }

                        holePath = new Path()
                            .moveTo(xv, yv)
                            .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                        holes.push(holePath);

                        kongpoint.push(0, xv, yv);
                    }

                    let kadv = p_yksctype === XQType.nx ? -cosA : p_yksctype === XQType.wx ? cosA : 0;
                    let kra = p_yksctype === XQType.normal ? 1 : sinA;

                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        let kx = W + c * kadv - p_lpch;
                        let ky = b;
                        let kz = c * kra

                        return [kx, ky, kz];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = SlotUtils.getECPlateRightBKVI(count, vertices, indices, facevec, fone, bone, holes, W, ZYKH, kadv, kra, AK.p_ykkw, p_lpch, true);

                    // 拉片槽定位
                    kongpoint = [];
                    for (let j = 0; j < yklpcdwAry.length; j++) {
                        xv = yklpcdwAry[j];
                        yv = BKH - BKKJMDis;

                        if (xv > minvecx[0] - BKDia / 2 || xv < minvecx[1] + BKDia / 2) {
                            continue;
                        }
                        kongpoint.push(0, xv, yv);
                    }

                    kadv = p_yksctype === XQType.nx ? -cosA : p_yksctype === XQType.wx ? cosA : 0;
                    kra = p_yksctype === XQType.normal ? 1 : sinA;

                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        let kx = W + c * kadv - p_lpch;
                        let ky = b;
                        let kz = c * kra

                        return [kx, ky, kz];
                    });

                    data.lpcdw.push({ key: AK.p_yklpcdw, dw: [...kongpoint], dir: [1, 0, 0] })
                }
            }
            else {
                let frontPath = [
                    new Vector2(0, 0),
                    new Vector2(0, zbklen),
                    new Vector2(L, zbklen),
                    new Vector2(L, 0)
                ]

                let backPath = [
                    new Vector2(0, 0),
                    new Vector2(0, zbklen),
                    new Vector2(L, zbklen),
                    new Vector2(L, 0)
                ];

                holes = [];
                kongpoint = [];
                for (i = 0; i < ykkpos.length; i++) {
                    xv = ykkpos[i];
                    yv = BKH - BKKJMDis;

                    let holePath = new Path();
                    holePath.moveTo(xv, yv)
                        .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(0, xv, yv);
                }

                if (p_yksctype === XQType.normal) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        return [W, b, c];
                    });
                    data.kongpoint.push(...kongpoint);

                    count = CommonUtils.getFaceByPaths(count, vertices, indices, facevec, backPath, frontPath, holes, 1, W, W - ZYKH, false, AK.p_ykkw);
                }
                else if (p_yksctype === XQType.nx) {
                    // 内斜
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                        return [W + c * -cosA, b, c * sinA];
                    });
                    data.kongpoint.push(...kongpoint);
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 0, 1, W - ZYKH, W, false, AK.p_ykkw)
                }
                else if (p_yksctype === XQType.wx) {
                    CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {
                        return [W + c * cosA, b, c * sinA];
                    });
                    data.kongpoint.push(...kongpoint);
                    // 外斜
                    count = CommonUtils.getXieShapeVI(count, vertices, indices, facevec, frontPath, backPath, holes, sinA, cosA, 1, 1, W - ZYKH, W, false, AK.p_ykkw)
                }
            }
        }

        let zxxie = 0;
        let yxxie = 0;
        if (p_ecplateLtype === 1) {
            // 左侧
            zxxie = p_zksctype === XQType.nx ? bkxie : p_zksctype === XQType.wx ? -bkxie : 0;
        }
        else {
            yxxie = p_yksctype === XQType.nx ? -bkxie : p_yksctype === XQType.wx ? bkxie : 0;
        }
        // 上边框
        if (p_sksctype != XQType.none) {
            path = p_sksctype === XQType.mf ? [
                new Vector2(0, 0),
                new Vector2(0, H),
                new Vector2(W, H),
                new Vector2(W, 0)
            ] : [
                new Vector2(0, 0),
                new Vector2(zxxie, BKH),
                new Vector2(W + yxxie, BKH),
                new Vector2(W, 0)
            ]

            if (p_sksctype === XQType.mf) {
                if (BIM.simpleMold) {
                    let skpath = []
                    for (i = 0; i < path.length; i++) {
                        skpath.push(new Vector3(path[i].x, L, path[i].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, skpath, path, null, AK.p_skkw,
                        (a: number, b: number) => [a, L, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, L, L - SXKH, false, AK.p_skkw);
                }
            }
            else {
                let filterNum = 0;
                let skkw = AModelFmulaUtils.getHolesbyExpress(p_skkw, W, 2, data, AK.p_skkw);
                holes = [];
                kongpoint = [];
                for (i = 0; i < skkw.length; i++) {
                    xv = skkw[i];
                    yv = BKH - BKKJMDis;

                    if (!CommonUtils.checkHoleInFace(new Vector2(xv, yv), path)) {
                        filterNum++;
                        continue;
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, L, yv);
                }
                data.kongpoint.push(...kongpoint);
                AModelFmulaUtils.getHolesbyExpress(p_skkw, W, 2, data, AK.p_skkw, filterNum);

                if (BIM.simpleMold) {
                    let skpath = []
                    for (i = 0; i < path.length; i++) {
                        skpath.push(new Vector3(path[i].x, L, path[i].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, skpath, path, holes, AK.p_skkw,
                        (a: number, b: number) => [a, L, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, L, L - SXKH, false, AK.p_skkw);
                }
            }

        }

        // 下边框
        if (p_xksctype != XQType.none) {
            path = p_xksctype === XQType.mf ? [
                new Vector2(0, 0),
                new Vector2(0, H),
                new Vector2(W, H),
                new Vector2(W, 0)
            ] : [
                new Vector2(0, 0),
                new Vector2(zxxie, BKH),
                new Vector2(W + yxxie, BKH),
                new Vector2(W, 0)
            ]

            if (p_xksctype === XQType.mf) {
                if (BIM.simpleMold) {
                    let xkpath = []
                    for (i = 0; i < path.length; i++) {
                        xkpath.push(new Vector3(path[i].x, 0, path[i].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, xkpath, path, null, AK.p_xkkw,
                        (a: number, b: number) => [a, 0, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null, 2, 0, SXKH, false, AK.p_xkkw);
                }
            }
            else {
                let filterNum = 0;
                let xkkw = AModelFmulaUtils.getHolesbyExpress(p_xkkw, W, 2, data, AK.p_xkkw);
                holes = [];
                kongpoint = [];
                for (i = 0; i < xkkw.length; i++) {
                    xv = xkkw[i];
                    yv = BKH - BKKJMDis;

                    if (!CommonUtils.checkHoleInFace(new Vector2(xv, yv), path)) {
                        filterNum++;
                        continue;
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, 0, yv);
                }
                data.kongpoint.push(...kongpoint);

                AModelFmulaUtils.getHolesbyExpress(p_xkkw, W, 2, data, AK.p_xkkw, filterNum);

                if (BIM.simpleMold) {
                    let xkpath = []
                    for (i = 0; i < path.length; i++) {
                        xkpath.push(new Vector3(path[i].x, 0, path[i].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, xkpath, path, holes, AK.p_xkkw,
                        (a: number, b: number) => [a, 0, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, holes, 2, 0, SXKH, false, AK.p_xkkw);
                }
            }
        }

        // 易拆
        let xqbj = +data.xqbj;
        let zyxqjl = +data.zyxqjl;
        let WC = CommonUtils.SqrtValue(YCJL, W);

        if (p_yctype === 3) {
            // 左右斜切
            count = SlotUtils.getECYiChaiVI(count, vertices, indices, facevec, data, L, W, WC, zyxqjl, BKH, SXKH, L - xqbj, zxxie, yxxie, true);
            count = SlotUtils.getECYiChaiVI(count, vertices, indices, facevec, data, L, W, WC, zyxqjl, BKH, SXKH, xqbj, zxxie, yxxie, false);
        }
        else if (data.p_yctype === 2) {
            // 右切
            count = SlotUtils.getECYiChaiVI(count, vertices, indices, facevec, data, L, W, WC, YCJL, BKH, SXKH, L / 2, zxxie, yxxie, true);

        }
        else if (data.p_yctype === 1) {
            // 左切
            count = SlotUtils.getECYiChaiVI(count, vertices, indices, facevec, data, L, W, WC, YCJL, BKH, SXKH, L / 2, zxxie, yxxie, false);
        }



        // 横肋
        let p_hldw = data.p_hldw;
        let HLW = +data.HLW;
        let HLH = +data.HLH;

        let zybkh = BIM.simpleMold ? 0 : ZYKH;
        let gmhd = BIM.simpleMold ? 0 : data.GMT;

        let hldw = AModelFmulaUtils.getHolesbyExpress(p_hldw, L, 2, data, AK.p_hldw);
        if (HLW && HLW > 0 && hldw && hldw.length > 0) {
            path = [
                new Vector2(zybkh, gmhd),
                new Vector2(zybkh + zxxie, BKH),
                new Vector2(W - zybkh + yxxie, BKH),
                new Vector2(W - zybkh, gmhd)
            ]

            let hlface: Vector3[];
            let pos: number, tt: number;
            for (i = 0; i < hldw.length; i++) {
                pos = hldw[i]
                if (BIM.simpleMold) {
                    hlface = [];
                    for (tt = 0; tt < path.length; tt++) {
                        hlface.push(new Vector3(path[tt].x, pos, path[tt].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, hlface, path, null, null,
                        (a: number, b: number) => [a, pos, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, path, null,
                        2, pos + HLW / 2, pos - HLW / 2, false, null);
                }

            }
        }

        return [vertices, indices, facevec];
    }


    static getObliqueSlotYichaiVI(count: number, vertices: number[], indices: number[], facevec: any[],
        len: number, W: number, BKH: number, xqbj: number, SXKH: number, zyxqjl: number, ztanB: number, zcosB: number,
        zxval: number, yxval: number, zcha: number, p_zypkk: string, p_yypkk: string, BKKJMDis: number,
        BKDia: number, isTop: boolean = false, toplen: boolean = false) {
        let ycData = toplen ? SlotUtils.getObliqueSlotYichaiFaceVI2(count, vertices, indices, facevec, len, W, BKH,
            xqbj, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, p_zypkk, p_yypkk, BKKJMDis, BKDia, isTop) :
            SlotUtils.getObliqueSlotYichaiFaceVI(count, vertices, indices, facevec, len, W, BKH,
                xqbj, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, p_zypkk, p_yypkk, BKKJMDis, BKDia, isTop);
        count = ycData[0];
        let ycface = ycData[1];

        if (!BIM.simpleMold) {
            let yctopData = toplen ? SlotUtils.getObliqueSlotYichaiFaceVI2(count, vertices, indices, facevec, len, W, BKH,
                xqbj + SXKH * zcosB, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, p_zypkk, p_yypkk, BKKJMDis, BKDia, isTop) :
                SlotUtils.getObliqueSlotYichaiFaceVI(count, vertices, indices, facevec, len, W, BKH,
                    xqbj + SXKH * zcosB, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, p_zypkk, p_yypkk, BKKJMDis, BKDia, isTop);
            count = yctopData[0];
            let yctopface = yctopData[1];
            // 侧边
            let side = CommonUtils.getSideVIF(ycface, yctopface, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];

            let ycbottomData = toplen ? SlotUtils.getObliqueSlotYichaiFaceVI2(count, vertices, indices, facevec, len, W, BKH,
                xqbj - SXKH * zcosB, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, p_zypkk, p_yypkk, BKKJMDis, BKDia, isTop) :
                SlotUtils.getObliqueSlotYichaiFaceVI(count, vertices, indices, facevec, len, W, BKH,
                    xqbj - SXKH * zcosB, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, p_zypkk, p_yypkk, BKKJMDis, BKDia, isTop);
            count = ycbottomData[0];
            let ycbottomface = ycbottomData[1];
            // 侧边
            side = CommonUtils.getSideVIF(ycface, ycbottomface, count);
            vertices.push(...side[0]);
            indices.push(...side[1]);
            facevec.push(...side[2]);
            count = side[3];
        }

        return count;
    }

    static getObliqueSlotYichaiFaceVI2(count: number, vertices: number[], indices: number[], facevec: any[],
        len: number, W: number, BKH: number, xqbj: number, zyxqjl: number, ztanB: number, zcosB: number,
        zxval: number, yxval: number, zcha: number, p_zypkk: string, p_yypkk: string, BKKJMDis: number,
        BKDia: number, isTop: boolean = false): any[] {

        let yclen = len + xqbj * ztanB;
        let ycxie = CommonUtils.SqrtValue(zyxqjl, yclen);
        let yctanB = isTop ? zyxqjl / yclen : - zyxqjl / yclen;
        let yccosB = yclen / ycxie;
        let bkhval = BKH * zcosB * yccosB;

        if (!isTop) {
            let hudu1 = Math.acos(zcosB);
            let hudu2 = Math.acos(yccosB);
            let hudu = hudu1 + hudu2;
            let coshu = Math.cos(hudu);

            let xie = BKH * zcosB / coshu;

            bkhval = xie * yccosB;
        }
        let ycPath = [
            new Vector2(0, 0),
            new Vector2(0, W),
            new Vector2(bkhval, W + zxval),
            new Vector2(bkhval, BKH),
            new Vector2(yclen + yxval, BKH),
            new Vector2(yclen, 0)
        ];

        // 孔位
        let zypk = AModelFmulaUtils.getHolesbyExpress(p_zypkk, W, 2);
        let yypk = AModelFmulaUtils.getHolesbyExpress(p_yypkk, yclen, 2);

        let holePath: Path;
        let holes = [];
        let i: number, xv: number, yv: number;

        // 左平孔-宽
        for (i = 0; i < zypk.length; i++) {
            xv = (BKH - BKKJMDis) * zcosB * yccosB;
            yv = zypk[i];
            if (yv > W - BKDia / 2) {
                continue;
            }

            holePath = new Path()
                .moveTo(xv, yv)
                .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }

        // 右平孔-高
        for (i = 0; i < yypk.length; i++) {
            xv = yypk[i] * zcosB * yccosB;
            yv = BKH - BKKJMDis;
            if (xv > yclen - BKDia / 2) {
                continue;
            }
            holePath = new Path()
                .moveTo(xv, yv)
                .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }


        let topface = [];
        let topvec = [];

        // 面数据
        for (let i = 0; i < ycPath.length; i++) {
            topface.push(new Vector3(ycPath[i].x - (xqbj * ztanB), xqbj + ycPath[i].x * yctanB, ycPath[i].y));
        }
        topvec = topface.concat(topface[0].clone());

        // 面
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [], ycPath, holes, null,
            (a, b) => [a - (xqbj * ztanB), xqbj + a * yctanB, b]
        );

        return [count, topvec];
    }

    static getObliqueSlotYichaiFaceVI(count: number, vertices: number[], indices: number[], facevec: any[],
        len: number, W: number, BKH: number, xqbj: number, zyxqjl: number, ztanB: number, zcosB: number,
        zxval: number, yxval: number, zcha: number, p_zypkk: string, p_yypkk: string, BKKJMDis: number,
        BKDia: number, isTop: boolean = false): any[] {



        let yclen = len - xqbj * ztanB;
        let ycxie = CommonUtils.SqrtValue(zyxqjl, yclen);
        let yctanB = isTop ? zyxqjl / yclen : - zyxqjl / yclen;
        let yccosB = yclen / ycxie;
        let bkhval = BKH * zcosB * yccosB;
        if (isTop) {
            let hudu1 = Math.acos(zcosB);
            let hudu2 = Math.acos(yccosB);
            let hudu = hudu1 + hudu2;
            let coshu = Math.cos(hudu);

            let xie = BKH * zcosB / coshu;

            bkhval = xie * yccosB;
        }
        let ycPath = [
            new Vector2(0, 0),
            new Vector2(0, W),
            new Vector2(bkhval, W + zxval),
            new Vector2(bkhval, BKH),
            new Vector2(yclen + yxval, BKH),
            new Vector2(yclen, 0)
        ];

        // 孔位
        let zypk = AModelFmulaUtils.getHolesbyExpress(p_zypkk, W, 2);
        let yypk = AModelFmulaUtils.getHolesbyExpress(p_yypkk, yclen, 2);

        let holePath: Path;
        let holes = [];
        let i: number, xv: number, yv: number;

        // 左平孔-宽
        for (i = 0; i < zypk.length; i++) {
            xv = (BKH - BKKJMDis) * zcosB * yccosB;
            yv = zypk[i];
            if (yv > W - BKDia / 2) {
                continue;
            }

            holePath = new Path()
                .moveTo(xv, yv)
                .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }

        // 右平孔-高
        for (i = 0; i < yypk.length; i++) {
            xv = yypk[i] * zcosB * yccosB;
            yv = BKH - BKKJMDis;
            if (xv > len - BKDia / 2) {
                continue;
            }
            holePath = new Path()
                .moveTo(xv, yv)
                .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

            holes.push(holePath);
        }


        let topface = [];
        let topvec = [];

        // 面数据
        for (let i = 0; i < ycPath.length; i++) {
            topface.push(new Vector3(ycPath[i].x + (xqbj * ztanB - zcha), xqbj + ycPath[i].x * yctanB, ycPath[i].y));
        }
        topvec = topface.concat(topface[0].clone());

        // 面
        count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, [], ycPath, holes, null,
            (a, b) => [a + (xqbj * ztanB - zcha), xqbj + a * yctanB, b]
        );

        return [count, topvec];
    }

    static getLeftObliqueSlotGapPath(data: ALParams, xzioxie: number[], syioxie: number[],
        L: number, W: number, len: number, QKH: number, QKW: number, p_lpck: number, p_lpch: number,
        zcosB: number, zkqkdw: string, p_zklpcdw?: number[], isTopMax: boolean = true): any[] {

        let zposAry = [];

        let frontPath = isTopMax ? [
            [0 - syioxie[0], 0],
            [0 - syioxie[1], W],
            [L - xzioxie[1], W],
            [L - xzioxie[0], 0],
            [0 - syioxie[0], 0]
        ] : [
            [0 + xzioxie[0], 0],
            [0 + xzioxie[1], W],
            [L + syioxie[1], W],
            [L + syioxie[0], 0],
            [0 + syioxie[0], 0]
        ];

        let backPath = isTopMax ? [

            [0 - syioxie[6], 0],
            [0 - syioxie[7], W + len],
            [L - xzioxie[7], W + len],
            [L - xzioxie[6], 0],
            [0 - syioxie[6], 0]
        ] : [
            [0 + xzioxie[0], 0],
            [0 + xzioxie[1], W + len],
            [L + syioxie[1], W + len],
            [L + syioxie[0], 0],
            [0 + syioxie[0], 0]
        ];

        let fronpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let fd, bd;
        let i: number, j: number;
        let backdiff: any;
        let frontdiff: any;
        let leftpos: number = 0;

        if (QKH > 0 && QKW > 0) {

            let zkqkdwAry = CommonUtils.getQKAry(zkqkdw, L)
            if (zkqkdwAry.length > 0) {
                for (i = 0; i < zkqkdwAry.length; i++) {
                    leftpos += Number(zkqkdwAry[i]) / zcosB;
                    zposAry.push([leftpos - QKW / 2, leftpos + QKW / 2]);
                    if (leftpos > 0) {
                        let leftpathf = isTopMax ? [
                            [L - (leftpos - QKW / 2), W],
                            [L - (leftpos - QKW / 2), W - QKH],
                            [L - (leftpos + QKW / 2), W - QKH],
                            [L - (leftpos + QKW / 2), W],

                            [L - (leftpos - QKW / 2), W]
                        ] : [
                            [leftpos - QKW / 2, W],
                            [leftpos - QKW / 2, W - QKH],
                            [leftpos + QKW / 2, W - QKH],
                            [leftpos + QKW / 2, W],

                            [leftpos - QKW / 2, W]
                        ]

                        let leftpathb = isTopMax ? [
                            [L - (leftpos - QKW / 2), W + len],
                            [L - (leftpos - QKW / 2), W + len - QKH],
                            [L - (leftpos + QKW / 2), W + len - QKH],
                            [L - (leftpos + QKW / 2), W + len],

                            [L - (leftpos - QKW / 2), W + len]
                        ] : [
                            [leftpos - QKW / 2, W + len],
                            [leftpos - QKW / 2, W + len - QKH],
                            [leftpos + QKW / 2, W + len - QKH],
                            [leftpos + QKW / 2, W + len],

                            [leftpos - QKW / 2, W + len]
                        ]

                        let fpoly = polygon([leftpathf]);
                        let bpoly = polygon([leftpathb])

                        frontdiff = difference(fronpoly, fpoly);
                        backdiff = difference(backpoly, bpoly);

                        fd = frontdiff.geometry.coordinates;
                        bd = backdiff.geometry.coordinates;

                        if (fd.length > 1) {
                            fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                        }
                        if (bd.length > 1) {
                            bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                        }
                        fronpoly = polygon(fd);
                        backpoly = polygon(bd);
                    }
                }
            }
        }

        if (p_zklpcdw.length > 0) {

            for (i = 0; i < p_zklpcdw.length; i++) {
                leftpos = Number(p_zklpcdw[i]) / zcosB;

                if (leftpos > 0 && CommonUtils.pathxj(leftpos - p_lpck / 2, leftpos + p_lpck / 2, zposAry)) {
                    let leftpathf = isTopMax ? [
                        [L - (leftpos - p_lpck / 2), W],
                        [L - (leftpos - p_lpck / 2), W - p_lpch],
                        [L - (leftpos + p_lpck / 2), W - p_lpch],
                        [L - (leftpos + p_lpck / 2), W],

                        [L - (leftpos - p_lpck / 2), W]
                    ] : [
                        [leftpos - p_lpck / 2, W],
                        [leftpos - p_lpck / 2, W - p_lpch],
                        [leftpos + p_lpck / 2, W - p_lpch],
                        [leftpos + p_lpck / 2, W],

                        [leftpos - p_lpck / 2, W]
                    ]

                    let leftpathb = isTopMax ? [
                        [L - (leftpos - p_lpck / 2), W + len],
                        [L - (leftpos - p_lpck / 2), W + len - p_lpch],
                        [L - (leftpos + p_lpck / 2), W + len - p_lpch],
                        [L - (leftpos + p_lpck / 2), W + len],

                        [L - (leftpos - p_lpck / 2), W + len]
                    ] : [
                        [leftpos - p_lpck / 2, W + len],
                        [leftpos - p_lpck / 2, W + len - p_lpch],
                        [leftpos + p_lpck / 2, W + len - p_lpch],
                        [leftpos + p_lpck / 2, W + len],

                        [leftpos - p_lpck / 2, W + len]
                    ]

                    let fpoly = polygon([leftpathf]);
                    let bpoly = polygon([leftpathb])

                    frontdiff = difference(fronpoly, fpoly);
                    backdiff = difference(backpoly, bpoly);

                    fd = frontdiff.geometry.coordinates;
                    bd = backdiff.geometry.coordinates;

                    if (fd.length > 1) {
                        fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                    }
                    if (bd.length > 1) {
                        bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                    }
                    fronpoly = polygon(fd);
                    backpoly = polygon(bd);
                }
            }
        }

        let frontpathVec: any[] = [];
        let backpathVec: any[] = [];
        if (fd && fd.length > 0) {
            for (let i = 0; i < fd[0].length; i++) {
                frontpathVec.push(new Vector2(fd[0][i][0], fd[0][i][1]));
            }
        }
        if (bd && bd.length > 0) {
            for (let i = 0; i < bd[0].length; i++) {
                backpathVec.push(new Vector2(bd[0][i][0], bd[0][i][1]));
            }
        }
        return [frontpathVec, backpathVec];
    }

    static getRightObliqueSlotGapPath(data: ALParams, xzioxie: number[], syioxie: number[],
        L: number, H: number, len: number, zcha: number, QKH: number, QKW: number, p_lpck: number, p_lpch: number,
        ykqkdw: string, p_yklpcdw: number[], isTopMax: boolean = true): any[] {

        let frontPath = isTopMax ? [
            [0, 0 + xzioxie[0]],
            [H + len, 0 + xzioxie[5]],
            [H + len, L + syioxie[5]],
            [-zcha, L + syioxie[0]],
            [0, 0 + xzioxie[0]]
        ] : [
            [-zcha, 0 + xzioxie[0]],
            [H + len, 0 + xzioxie[5]],
            [H + len, L + syioxie[5]],
            [0, L + syioxie[0]],
            [-zcha, 0 + xzioxie[0]]
        ];

        let backPath = isTopMax ? [

            [0, 0 + xzioxie[0]],
            [H, 0 + xzioxie[5]],
            [H, L + syioxie[5]],
            [-zcha, L + syioxie[0]],
            [0, 0 + xzioxie[0]]
        ] : [
            [-zcha, 0 + xzioxie[0]],
            [H, 0 + xzioxie[5]],
            [H, L + syioxie[5]],
            [0, L + syioxie[0]],
            [-zcha, 0 + xzioxie[0]]
        ];

        let fronpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let fd, bd;
        let i: number, j: number;
        let backdiff: any;
        let frontdiff: any;
        let rightpos: number = 0;
        let yposAry = [];

        if (QKH > 0 && QKW > 0) {

            let ykqkdwAry = CommonUtils.getQKAry(ykqkdw, L)
            if (ykqkdwAry.length > 0) {
                for (i = 0; i < ykqkdwAry.length; i++) {
                    rightpos += Number(ykqkdwAry[i]);
                    yposAry.push([rightpos - QKW / 2, rightpos + QKW / 2]);
                    if (rightpos > 0) {
                        let fpath = [
                            [H + len - QKH, rightpos - QKW / 2],
                            [H + len, rightpos - QKW / 2],
                            [H + len, rightpos + QKW / 2],
                            [H + len - QKH, rightpos + QKW / 2],
                            [H + len - QKH, rightpos - QKW / 2],
                        ]

                        let bpath = [
                            [H - QKH, rightpos - QKW / 2],
                            [H, rightpos - QKW / 2],
                            [H, rightpos + QKW / 2],
                            [H - QKH, rightpos + QKW / 2],
                            [H - QKH, rightpos - QKW / 2],
                        ]

                        let fpoly = polygon([fpath]);
                        let bpoly = polygon([bpath])

                        frontdiff = difference(fronpoly, fpoly);
                        backdiff = difference(backpoly, bpoly);

                        fd = frontdiff.geometry.coordinates;
                        bd = backdiff.geometry.coordinates;
                        if (fd.length > 1) {
                            fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                        }
                        if (bd.length > 1) {
                            bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                        }
                        fronpoly = polygon(fd);
                        backpoly = polygon(bd);
                    }
                }
            }
        }

        if (p_yklpcdw.length > 0) {
            for (i = 0; i < p_yklpcdw.length; i++) {
                rightpos = Number(p_yklpcdw[i]);

                if (rightpos > 0 && CommonUtils.pathxj(rightpos - p_lpck / 2, rightpos + p_lpck / 2, yposAry)) {
                    let fpath = [
                        [H + len - p_lpch, rightpos - p_lpck / 2],
                        [H + len, rightpos - p_lpck / 2],
                        [H + len, rightpos + p_lpck / 2],
                        [H + len - p_lpch, rightpos + p_lpck / 2],
                        [H + len - p_lpch, rightpos - p_lpck / 2],
                    ]

                    let bpath = [
                        [H - p_lpch, rightpos - p_lpck / 2],
                        [H, rightpos - p_lpck / 2],
                        [H, rightpos + p_lpck / 2],
                        [H - p_lpch, rightpos + p_lpck / 2],
                        [H - p_lpch, rightpos - p_lpck / 2],
                    ]

                    let fpoly = polygon([fpath]);
                    let bpoly = polygon([bpath])

                    frontdiff = difference(fronpoly, fpoly);
                    backdiff = difference(backpoly, bpoly);

                    fd = frontdiff.geometry.coordinates;
                    bd = backdiff.geometry.coordinates;
                    if (fd.length > 1) {
                        fd = fd[0][0].length > fd[1][0].length ? fd[0] : fd[1];
                    }
                    if (bd.length > 1) {
                        bd = bd[0][0].length > bd[1][0].length ? bd[0] : bd[1];
                    }
                    fronpoly = polygon(fd);
                    backpoly = polygon(bd);
                }
            }
        }

        let frontpathVec: any[] = [];
        let backpathVec: any[] = [];
        if (fd && fd.length > 0) {
            for (let i = 0; i < fd[0].length; i++) {
                frontpathVec.push(new Vector2(fd[0][i][0], fd[0][i][1]));
            }
        }
        if (bd && bd.length > 0) {
            for (let i = 0; i < bd[0].length; i++) {
                backpathVec.push(new Vector2(bd[0][i][0], bd[0][i][1]));
            }
        }
        return [frontpathVec, backpathVec];
    }


    static getObliqueSlotLeftBKPath(data: ALParams, L: number, len: number, QKH: number, QKW: number, p_lpck: number,
        xzioxie: number[], syioxie: number[], zkqkdw: string, lpkw: number[]) {

        let frontPath: number[][], backPath: number[][];
        frontPath = [
            [0, 0 + xzioxie[1]],
            [len, 0 + xzioxie[2]],
            [len, L + syioxie[2]],
            [0, L + syioxie[1]],
            [0, 0 + xzioxie[1]]
        ]

        backPath = [
            [0, 0 + xzioxie[8]],
            [len, 0 + xzioxie[9]],
            [len, L + syioxie[9]],
            [0, L + syioxie[8]],
            [0, 0 + xzioxie[8]]
        ]

        let fisone = false;
        let bisone = false;
        let frontpoly = polygon([frontPath]);
        let backpoly = polygon([backPath]);

        let fpathVec: number[][], bpathVec: number[][];
        let fdiff: any, bdiff: any;
        let fresult: any[] = [];
        let bresult: any[] = [];
        let i: number, j: number;

        let leftpos: number = 0;

        let zposAry = []; //缺口范围
        let zlpfAry = [];
        let zlpbAry = [];

        // 缺口
        if (QKH > 0 && QKW > 0) {

            let zkqkdwAry = CommonUtils.getQKAry(zkqkdw, L);
            if (zkqkdwAry.length > 0) {
                for (i = 0; i < zkqkdwAry.length; i++) {
                    leftpos += Number(zkqkdwAry[i]);
                    zposAry.push([leftpos - QKW / 2, leftpos + QKW / 2]);
                    if (leftpos > 0) {

                        let walltp = leftpos + QKW / 2;
                        let wallbp = leftpos - QKW / 2;

                        fpathVec = [
                            [0, wallbp],
                            [len, wallbp],
                            [len, walltp],
                            [0, walltp],
                            [0, wallbp]
                        ]

                        bpathVec = [
                            [0, wallbp],
                            [len, wallbp],
                            [len, walltp],
                            [0, walltp],
                            [0, wallbp]
                        ]

                        let tpoly = polygon([fpathVec]);
                        let bpoly = polygon([bpathVec]);

                        let fg = difference(frontpoly, tpoly);
                        fdiff = fg.geometry.coordinates;

                        if (fdiff && fdiff.length > 0) {
                            fisone = fdiff.length === 1;
                            if (fisone) {

                                frontpoly = polygon(fdiff)
                            }
                            else {
                                fresult = fresult.concat(fdiff[0]);
                            }
                            if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                        }

                        let bg = difference(backpoly, bpoly);
                        bdiff = bg.geometry.coordinates;

                        if (bdiff && bdiff.length > 0) {
                            bisone = bdiff.length === 1;
                            if (bisone) {
                                backpoly = polygon(bdiff)
                            }
                            else {
                                bresult = bresult.concat(bdiff[0]);
                            }
                            if (bdiff.length > 1) backpoly = polygon(bdiff[1]);
                        }
                    }
                }
                fresult = fresult.concat(frontpoly.geometry.coordinates);
                bresult = bresult.concat(backpoly.geometry.coordinates);
            }
        }



        let p_zklpcdw = AModelFmulaUtils.getHolesbyExpress(data.p_zklpcdw, L, 2, data, AK.p_zklpcdw);
        if (p_zklpcdw.length > 0) {

            for (i = 0; i < p_zklpcdw.length; i++) {
                leftpos = Number(p_zklpcdw[i]);

                if (leftpos > 0 && CommonUtils.pathxj(leftpos - p_lpck / 2, leftpos + p_lpck / 2, zposAry)) {

                    let walltp = leftpos + p_lpck / 2;
                    let wallbp = leftpos - p_lpck / 2;

                    fpathVec = [
                        [0, wallbp],
                        [len, wallbp],
                        [len, walltp],
                        [0, walltp],
                        [0, wallbp]
                    ]

                    bpathVec = [
                        [0, wallbp],
                        [len, wallbp],
                        [len, walltp],
                        [0, walltp],
                        [0, wallbp]
                    ]


                    let tpoly = polygon([fpathVec]);
                    let bpoly = polygon([bpathVec]);

                    let fg = difference(frontpoly, tpoly);
                    fdiff = fg.geometry.coordinates;

                    if (fdiff && fdiff.length > 0) {
                        fisone = fdiff.length === 1;
                        if (fisone) {
                            // fresult = fresult.concat(fdiff);
                            frontpoly = polygon(fdiff)
                        }
                        else {
                            fresult = fresult.concat(fdiff[0]);
                        }
                        // result = result.concat(dd[0]);
                        if (fdiff.length > 1) frontpoly = polygon(fdiff[1]);
                    }

                    let bg = difference(backpoly, bpoly);
                    bdiff = bg.geometry.coordinates;

                    if (bdiff && bdiff.length > 0) {
                        bisone = bdiff.length === 1;
                        if (bisone) {
                            // bresult = bresult.concat(bdiff);
                            backpoly = polygon(bdiff)
                        }
                        else {
                            bresult = bresult.concat(bdiff[0]);
                        }
                        // result = result.concat(dd[0]);
                        if (bdiff.length > 1) backpoly = polygon(bdiff[1]);
                    }

                    zlpfAry.push(fpathVec); //路径
                    zlpbAry.push(bpathVec);
                    if (lpkw) lpkw.push(leftpos);
                }
            }
            fresult = fresult.concat(frontpoly.geometry.coordinates);
            bresult = bresult.concat(backpoly.geometry.coordinates);
        }

        let ftarget: any[] = [];
        let foneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            foneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                foneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            ftarget.push(foneVec);
        }

        let btarget: any[] = [];
        let oneVec: Vector2[];
        for (i = 0; i < fresult.length; i++) {
            oneVec = [];
            for (j = 0; j < fresult[i].length; j++) {
                oneVec.push(new Vector2(fresult[i][j][0], fresult[i][j][1]));
            }
            btarget.push(oneVec);
        }

        let flp: any[] = [];
        let blp: any[] = [];
        if (zlpfAry.length > 0) {
            for (i = 0; i < zlpfAry.length; i++) {
                foneVec = [];
                for (j = 0; j < zlpfAry[i].length; j++) {
                    foneVec.push(new Vector2(zlpfAry[i][j][0], zlpfAry[i][j][1]));
                }
                flp.push(foneVec);
            }

            for (i = 0; i < zlpbAry.length; i++) {
                oneVec = [];
                for (j = 0; j < zlpbAry[i].length; j++) {
                    oneVec.push(new Vector2(zlpbAry[i][j][0], zlpbAry[i][j][1]));
                }
                blp.push(oneVec);
            }
        }

        return { front: ftarget, back: btarget, frontlp: flp, backlp: blp };
    }

    static getCHolesData(r: string, dw: string, zsinB: number, zcosB: number, zcha: number, L: number, normal: Vector3, isL: boolean = false) {

        let holes = [];

        CommonUtils.getGmtHoles(r, dw, holes, 1);


        let tho = []
        for (let i = 0; i < holes.length; i++) {

            if (isL) {
                tho.push(holes[i].curves[0].aX * zsinB - zcha, holes[i].curves[0].aX * zcosB, holes[i].curves[0].aY);
            }
            else {
                tho.push(-holes[i].curves[0].aX * zsinB, holes[i].curves[0].aX * zcosB, holes[i].curves[0].aY);
            }


        }
        return { rad: r, holes: tho, dir: [normal.x, normal.y, normal.z] };

    }


    /** 获取斜边c槽数据 */
    static getObliqueSlotVI(data: ALParams): any[] {

        // 数据
        let vertices: any[] = [];
        let indices: any[] = [];
        let facevec: any[] = [];
        // 计数
        let count: number = 0;

        let H = +data.H;
        let W = +data.W;
        let L = +data.L;

        // 上高下高
        let p_th = +data.p_th;
        let p_bh = +data.p_bh;

        if (!data.BKH) {
            data.BKH = 65;
            if (data.SKH && +data.SKH > 0) {
                data.BKH = +data.SKH;
            }
        }

        if (p_th === p_bh) {
            return SlotUtils.getSlotVI(false, data, p_th);
        }

        let BKH = +data.BKH;
        let BKKJMDis = +data.BKKJMDis;
        let ZYKH = +data.ZYKH;
        let SXKH = +data.SXKH;
        let BKDia = +data.BKDia;

        let GMT = +data.GMT;
        let YCJL = +data.YCJL;
        let kkzj = +data.kkzj;
        let p_kbj = +data.p_kbj;

        // 缩进
        let fbsj = +data.fbsj;

        // 拉片
        let p_lpch = +data.p_lpch;
        let p_lpck = +data.p_lpck;

        // 缺口
        let QKH: number = +data.p_qkh;
        let QKW: number = +data.p_qkw;

        // 封板类型
        let p_xzfentype = data.p_xzfentype;
        let p_syfentype = data.p_syfentype;
        let p_zksctype = data.p_zksctype;
        let p_yksctype = data.p_yksctype;
        let p_xzxqtype = data.p_xzxqtype;
        let p_syxqtype = data.p_syxqtype;
        let p_yctype = data.p_yctype;

        let XQNXJL = +data.XQNXJL;
        let XBNXJD = +data.XBNXJD;
        let radian = XBNXJD / 180 * Math.PI;
        let cosA = Math.cos(radian);
        let sinA = Math.sin(radian);
        let tanA = Math.tan(radian);

        let path: Vector2[] = [];
        let holes: Path[] = [];
        let holePath: Path;


        let maxH = Math.max(p_bh, p_th);
        let minH = Math.min(p_bh, p_th);

        // 内外斜
        let xval = BKH / tanA;

        let zxval = p_zksctype == XQType.nx ? -xval : p_zksctype == XQType.wx ? xval : 0;
        let yxval = p_yksctype == XQType.nx ? -xval : p_yksctype == XQType.wx ? xval : 0;

        // 左翼外斜
        let xzioxie = SlotUtils.getIOXie(tanA, sinA, W, p_bh, XQNXJL, BKH, GMT, ZYKH, p_zksctype, p_yksctype, p_xzxqtype, false);
        let syioxie = SlotUtils.getIOXie(tanA, sinA, W, p_th, XQNXJL, BKH, GMT, ZYKH, p_zksctype, p_yksctype, p_syxqtype, true);

        // 左侧数据
        let zcha = Math.abs(maxH - minH);
        let zgmL = CommonUtils.SqrtValue(L, zcha);

        data['p_zcha'] =zcha; 

        let zcosB = L / zgmL;
        let zsinB = zcha / zgmL;
        let ztanB = zcha / L;
        // 上比下长
        let isTopMax: boolean = p_th > p_bh;

        // 添加光面孔位
        let zngmface = [];
        let zgmface = [];

        // 拉片槽
        let p_zklpcdw = data.p_zklpcdw;
        let p_yklpcdw = data.p_yklpcdw;
        let zklpcdw = AModelFmulaUtils.getHolesbyExpress(p_zklpcdw, L, 2, data, AK.p_zklpcdw);
        let yklpcdw = AModelFmulaUtils.getHolesbyExpress(p_yklpcdw, L, 2, data, AK.p_yklpcdw);

        let i: number, xv: number, yv: number;

        //  边框孔中心点
        data.kongpoint = [];
        let kongpoint = [];

        data.lpcdw = [];

        let tanB: number;
        let WC: number;
        let HC: number;

        data.gmholes = [];

        // 上长
        if (isTopMax) {

            data.duan = [
                -zcha, L, W,
                -zcha, L, 0,
                minH, L, 0,

                0, 0, 0,
                minH, 0, 0,
                0, 0, W
            ];

            if (p_xzfentype === XQType.sj) {
                data.duan.push(
                    -fbsj * ztanB, fbsj, W,
                    -fbsj * ztanB, fbsj, 0,
                    minH, fbsj, 0,
                )
            }
            else {
                data.duan.push(
                    -50 * ztanB, 50, W,
                    -50 * ztanB, 50, 0,
                    minH, 50, 0,
                    -100 * ztanB, 100, 0
                )
            }

            if (p_syfentype === XQType.sj) {
                data.duan.push(
                    -(L - fbsj) * ztanB, L - fbsj, W,
                    -(L - fbsj) * ztanB, L - fbsj, 0,
                    minH, L - fbsj, 0,
                )
            }
            else {
                data.duan.push(
                    -(L - 50) * ztanB, L - 50, W,
                    -(L - 50) * ztanB, L - 50, 0,
                    minH, L - 50, 0,
                    -(L - 100) * ztanB, L - 100, 0
                )
            }

            data.zhong = {
                L: [
                    {
                        pointer: [minH / 2, L, 0],
                        center: [minH / 2, L / 2, 0],

                    },
                    {
                        pointer: [-zcha, L, W / 2],
                        center: [-zcha, L / 2, W / 2],

                    }
                ],
                RL: [
                    {
                        pointer: [minH / 2, 0, 0],
                        center: [minH / 2, L / 2, 0],
                        dir: [0, 0, 0]
                    },
                    {
                        pointer: [0, 0, W / 2],
                        center: [0, L / 2, W / 2],
                    }
                ],

                W: [
                    {
                        pointer: [-L / 2 * ztanB, L / 2, W],
                        center: [-L / 2 * ztanB, L / 2, W / 2],

                    }
                ],

                minH: [
                    {
                        pointer: [minH, L / 2, 0],
                        center: [minH / 2, L / 2, 0],
                    }
                ]
            }

            // 左侧面孔
            let zgmpath = [
                new Vector2(0 - syioxie[0], 0),
                new Vector2(0 - syioxie[1], W),
                new Vector2(zgmL - xzioxie[1], W),
                new Vector2(zgmL - xzioxie[0], 0)
            ];

            let ZL = p_zksctype === XQType.nx ? -GMT / tanA : p_zksctype === XQType.wx ? GMT / tanA : 0;
            // 左缺口
            let leftpathv = SlotUtils.getLeftObliqueSlotGapPath(data, xzioxie, syioxie, zgmL, W, ZL, QKH, QKW, p_lpck, p_lpch, zcosB, data.p_zkqkdw, zklpcdw);
            if (CommonUtils.haveData(leftpathv) && QKH < W) {
                zgmpath = leftpathv[0];
                zgmpath.pop();
            }

            let zspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zspkfa], W, 2, null, null, 10008);

            let zgmkw: string = "";
            if (p_xzfentype === XQType.sj) {
                for (let i = 0; i < zspkfa.length; i++) {

                    xv = p_kbj;
                    yv = zspkfa[i];

                    zgmkw += "(" + yv + "," + xv + ")";
                }
            }

            if (p_syfentype === XQType.sj) {
                for (let i = 0; i < zspkfa.length; i++) {
                    xv = L - p_kbj;
                    yv = zspkfa[i];

                    zgmkw += "(" + yv + "," + xv + ")";
                }
            }

            if (zgmkw !== "") {
                data.p_l_r3 = kkzj.toString();
                data.p_l_r3dw = zgmkw;
            }

            data.p_l_r1 = CommonUtils.checkRadiusIsLegal(data.p_l_r1);
            data.p_l_r2 = CommonUtils.checkRadiusIsLegal(data.p_l_r2);
            data.p_l_r3 = CommonUtils.checkRadiusIsLegal(data.p_l_r3);

            data.p_l_r1dw = CommonUtils.fliterOuterPoint(data.p_l_r1dw, zgmpath, true, false, false, true, data.p_l_r1.toString());
            data.p_l_r2dw = CommonUtils.fliterOuterPoint(data.p_l_r2dw, zgmpath, true, false, false, true, data.p_l_r2.toString());
            data.p_l_r3dw = CommonUtils.fliterOuterPoint(data.p_l_r3dw, zgmpath, true, false, false, true, data.p_l_r3.toString());

            holes = [];
            CommonUtils.getGmtHoles(data.p_l_r1, data.p_l_r1dw, holes, 1, false, zgmL, 0, null, true);
            CommonUtils.getGmtHoles(data.p_l_r2, data.p_l_r2dw, holes, 1, false, zgmL, 0, null, true);
            CommonUtils.getGmtHoles(data.p_l_r3, data.p_l_r3dw, holes, 1, false, zgmL, 0, null, true);

            CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 0, false, false, false, (a, b) => [a * zsinB - zcha, L - a * zcosB, b]);

            let xc = L * zsinB;
            let xd = xc * zcosB;
            let yd = xc * zsinB;
            let lnor = new Vector3(xd, yd, 0).normalize();
            data.gmholes.push(SlotUtils.getCHolesData(data.p_l_r1, data.p_l_r1dw, zsinB, zcosB, zcha, L, lnor.clone()));
            data.gmholes.push(SlotUtils.getCHolesData(data.p_l_r2, data.p_l_r2dw, zsinB, zcosB, zcha, L, lnor.clone()));
            data.gmholes.push(SlotUtils.getCHolesData(data.p_l_r3, data.p_l_r3dw, zsinB, zcosB, zcha, L, lnor.clone()));


            count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, zgmpath, holes, AK.p_l_r1dw, data.kongpoint,
                (a, b) => new Vector3(a * zsinB - zcha, L - a * zcosB, b),
                (a, b) => new Vector3(a * zsinB + GMT - zcha, L - a * zcosB, b),
                (a, b) => [a * zsinB - zcha, L - a * zcosB, b],
                (a, b) => [a * zsinB + GMT - zcha, L - a * zcosB, b],
            );


            // 右侧面孔
            let ygmpath = [
                new Vector2(0, 0 + xzioxie[0]),
                new Vector2(minH, 0 + xzioxie[5]),
                new Vector2(minH, L + syioxie[5]),
                new Vector2(-zcha, L + syioxie[0])
            ];

            // 右缺口
            let YL = p_yksctype === XQType.nx ? -GMT / tanA : p_yksctype === XQType.wx ? GMT / tanA : 0;
            let rightpathv = SlotUtils.getRightObliqueSlotGapPath(data, xzioxie, syioxie, L, minH, YL, zcha, QKH, QKW, p_lpck, p_lpch, data.p_ykqkdw, yklpcdw);
            if (CommonUtils.haveData(rightpathv) && QKH < minH) {
                ygmpath = rightpathv[0];
                ygmpath.pop();
            }


            let yspkfa: any[]
            let ygmkw: string = "";
            if (p_xzfentype === XQType.sj) {
                yspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_yspkfa], p_th, 2, null, null, 10008);
                for (let i = 0; i < yspkfa.length; i++) {
                    xv = yspkfa[i];
                    yv = p_kbj;
                    ygmkw += "(" + xv + "," + yv + ")";
                }
            }

            if (p_syfentype === XQType.sj) {
                yspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_yspkfa], p_bh, 2, null, null, 10008);
                for (let i = 0; i < yspkfa.length; i++) {
                    xv = yspkfa[i];
                    yv = L - p_kbj;
                    ygmkw += "(" + xv + "," + yv + ")";
                }
            }

            if (ygmkw !== "") {
                data.p_r_r3 = kkzj.toString();
                data.p_r_r3dw = ygmkw;
            }

            data.p_r_r1 = CommonUtils.checkRadiusIsLegal(data.p_r_r1);
            data.p_r_r2 = CommonUtils.checkRadiusIsLegal(data.p_r_r2);
            data.p_r_r3 = CommonUtils.checkRadiusIsLegal(data.p_r_r3);

            data.p_r_r1dw = CommonUtils.fliterOuterPoint(data.p_r_r1dw, ygmpath, false, false, false, true, data.p_r_r1.toString());
            data.p_r_r2dw = CommonUtils.fliterOuterPoint(data.p_r_r2dw, ygmpath, false, false, false, true, data.p_r_r2.toString());
            data.p_r_r3dw = CommonUtils.fliterOuterPoint(data.p_r_r3dw, ygmpath, false, false, false, true, data.p_r_r3.toString());

            holes = [];
            CommonUtils.getGmtHoles(data.p_r_r1, data.p_r_r1dw, holes);
            CommonUtils.getGmtHoles(data.p_r_r2, data.p_r_r2dw, holes);
            CommonUtils.getGmtHoles(data.p_r_r3, data.p_r_r3dw, holes);

            // 添加光面孔位
            CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint);


            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r1, data.p_r_r1dw, 0, ConstDef.znormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r2, data.p_r_r2dw, 0, ConstDef.znormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r3, data.p_r_r3dw, 0, ConstDef.znormal.clone()));

            let i: number;

            count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, ygmpath, holes, AK.p_r_r1dw, data.kongpoint,
                (a, b) => new Vector3(a, b, 0),
                (a, b) => new Vector3(a, b, GMT),
                (a, b) => [a, b, 0],
                (a, b) => [a, b, GMT]
            );

            // 右边框
            let ykkw = AModelFmulaUtils.getHolesbyExpress(data.p_ykkw, L, 2, data, AK.p_ykkw);

            let ylen = p_yksctype === XQType.normal ? BKH : BKH / sinA;

            let ylpkw = []
            let rightpv = SlotUtils.getNormalSlotRightGapPath(false, data, ylen, 0, 0, xzioxie, syioxie, true, ylpkw);
            let rigthqkvec = [rightpv.front, rightpv.back, rightpv.frontlp, rightpv.backlp];
            if (CommonUtils.haveData(rigthqkvec)) {

                if (QKH > 0 && QKW > 0 && QKH < H) {
                    for (i = 0; i < rigthqkvec[0].length; i++) {

                        let fone = rigthqkvec[0][i].concat();
                        let bone = rigthqkvec[1][i].concat();

                        let minvecx = CommonUtils.getVectorMinX(fone, bone);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < ykkw.length; j++) {
                            xv = ykkw[j];
                            yv = data.BKH - data.BKKJMDis;

                            if (xv > minvecx[0] - data.BKDia / 2 || xv < minvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;


                            return [minH + c * kadv, b, c * kra];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getRightSlotFengVI(count, vertices, indices, facevec, fone, bone, holes, minH, cosA, sinA, data, AK.p_ykkw);

                    }
                }
                if (rigthqkvec[2].length > 0 && rigthqkvec[3].length > 0) {
                    for (i = 0; i < rigthqkvec[2].length; i++) {

                        let rlpfone = rigthqkvec[2][i].concat();
                        let rlpbone = rigthqkvec[3][i].concat();

                        let rlpminvecx = CommonUtils.getVectorMinX(rlpfone, rlpbone);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < ykkw.length; j++) {
                            xv = ykkw[j];
                            yv = data.BKH - data.BKKJMDis;

                            if (xv > rlpminvecx[0] - data.BKDia / 2 || xv < rlpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            return [minH + c * kadv - p_lpch, b, c * kra];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getRightSlotFengVI(count, vertices, indices, facevec, rlpfone, rlpbone, holes, minH, cosA, sinA, data, AK.p_ykkw, true, p_lpch);


                        // 拉片槽位置

                        kongpoint = [];
                        for (let j = 0; j < ylpkw.length; j++) {
                            xv = ylpkw[j];
                            yv = data.BKH - data.BKKJMDis;

                            if (xv > rlpminvecx[0] - data.BKDia / 2 || xv < rlpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }



                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            return [minH + c * kadv - p_lpch, b, c * kra];
                        });
                        data.lpcdw.push({ key: AK.p_yklpcdw, dw: [...kongpoint], dir: [1, 0, 0] })
                    }

                }

            }
            else {
                holes = [];
                kongpoint = [];
                for (i = 0; i < ykkw.length; i++) {
                    xv = ykkw[i];
                    yv = BKH - BKKJMDis;

                    if (p_xzxqtype === XQType.cznx) {
                        if (xv < XQNXJL + BKDia / 2) {
                            continue;
                        }
                    }
                    if (p_syxqtype === XQType.cznx) {
                        if (xv > L - XQNXJL - BKDia / 2) {
                            continue;
                        }
                    }

                    holePath = new Path();
                    holePath.moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);
                    kongpoint.push(xv, yv, 0);
                }


                let rightPath = [
                    new Vector2(0 + xzioxie[5], 0),
                    new Vector2(0 + xzioxie[4], ylen),
                    new Vector2(L + syioxie[4], ylen),
                    new Vector2(L + syioxie[5], 0)
                ];

                if (p_yksctype === XQType.normal) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, rightPath, holes, AK.p_ykkw, data.kongpoint,
                        (a, b) => new Vector3(minH, a, b),
                        (a, b) => new Vector3(minH - ZYKH, a, b),
                        (a, b) => [minH, a, b],
                        (a, b) => [minH - ZYKH, a, b],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [minH, a, b])
                    );
                }
                else if (p_yksctype === XQType.nx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, rightPath, holes, AK.p_ykkw, data.kongpoint,
                        (a, b) => new Vector3(minH - b * cosA, a, b * sinA),
                        (a, b) => new Vector3(minH - ZYKH - b * cosA, a, b * sinA),
                        (a, b) => [minH - b * cosA, a, b * sinA],
                        (a, b) => [minH - ZYKH - b * cosA, a, b * sinA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [minH - b * cosA, a, b * sinA])
                    );
                }
                else if (p_yksctype === XQType.wx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, rightPath, holes, AK.p_ykkw, data.kongpoint,
                        (a, b) => new Vector3(minH + b * cosA, a, b * sinA),
                        (a, b) => new Vector3(minH - ZYKH + b * cosA, a, b * sinA),
                        (a, b) => [minH + b * cosA, a, b * sinA],
                        (a, b) => [minH - ZYKH + b * cosA, a, b * sinA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [minH + b * cosA, a, b * sinA])
                    );
                }
            }

            // 左边框
            let zlen = p_zksctype === XQType.normal ? BKH : BKH / sinA;

            let zkkw = AModelFmulaUtils.getHolesbyExpress(data.p_zkkw, L, 2, data, AK.p_zkkw);

            let leftLpdw = [];
            let leftpv = SlotUtils.getObliqueSlotLeftBKPath(data, L, zlen, QKH, QKW, p_lpck, xzioxie, syioxie, data.p_zkqkdw, leftLpdw);
            let leftqkvec = [leftpv.front, leftpv.back, leftpv.frontlp, leftpv.backlp];

            if (CommonUtils.haveData(leftqkvec)) {

                if (QKH > 0 && QKW > 0 && QKH < W) {
                    for (i = 0; i < leftqkvec[0].length; i++) {

                        let fone = leftqkvec[0][i].concat();
                        let bone = leftqkvec[1][i].concat();

                        let minvecx = CommonUtils.getVectorMinX(fone, bone, true);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < zkkw.length; j++) {
                            xv = BKH - BKKJMDis;
                            yv = zkkw[j];

                            if (yv > minvecx[0] - data.BKDia / 2 || yv < minvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(xv, yv, 0);
                        }

                        let kadv = p_zksctype === XQType.nx ? - cosA : p_zksctype === XQType.wx ? cosA : 0;
                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, fone, holes, AK.p_zkkw, data.kongpoint,
                            (a, b) => new Vector3((a - b * ztanB) * sinA, b, W + a * kadv),
                            (a, b) => new Vector3((a - b * ztanB) * sinA, b, W - ZYKH + a * kadv),
                            (a, b) => [(a - b * ztanB) * sinA, b, W + a * kadv],
                            (a, b) => [(a - b * ztanB) * sinA, b, W - ZYKH + a * kadv],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [(a - b * ztanB) * sinA, b, W + a * kadv])
                        );

                    }
                }

                if (leftqkvec[2].length > 0 && leftqkvec[3].length > 0) {
                    for (i = 0; i < leftqkvec[2].length; i++) {

                        let lpfone = leftqkvec[2][i].concat();
                        let lpbone = leftqkvec[3][i].concat();

                        let lpminvecx = CommonUtils.getVectorMinX(lpfone, lpbone, true);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < zkkw.length; j++) {
                            xv = BKH - BKKJMDis;
                            yv = zkkw[j];

                            if (yv > lpminvecx[0] - data.BKDia / 2 || yv < lpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(xv, yv, 0);
                        }


                        let kadv = p_zksctype === XQType.nx ? - cosA : p_zksctype === XQType.wx ? cosA : 0;
                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, lpfone, holes, AK.p_zkkw, data.kongpoint,
                            (a, b) => new Vector3((a - b * ztanB) * sinA, b, W + a * kadv - p_lpch),
                            (a, b) => new Vector3((a - b * ztanB) * sinA, b, W - ZYKH + a * kadv - p_lpch),
                            (a, b) => [(a - b * ztanB) * sinA, b, W + a * kadv - p_lpch],
                            (a, b) => [(a - b * ztanB) * sinA, b, W - ZYKH + a * kadv - p_lpch],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [(a - b * ztanB) * sinA, b, W + a * kadv - p_lpch])
                        );

                        // 拉片槽定位
                        kongpoint = [];
                        for (let j = 0; j < leftLpdw.length; j++) {
                            xv = BKH - BKKJMDis;
                            yv = leftLpdw[j];

                            if (yv > lpminvecx[0] - data.BKDia / 2 || yv < lpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }


                            kongpoint.push(xv, yv, 0);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [(a - b * ztanB) * sinA, b, W + a * kadv - p_lpch])
                        data.lpcdw.push({ key: AK.p_zklpcdw, dw: [...kongpoint], dir: [0, 0, 1] })

                    }
                }
            }
            else {
                let leftPath = [
                    new Vector2(0, 0 + xzioxie[1]),
                    new Vector2(BKH, 0 + xzioxie[2]),
                    new Vector2(BKH, L + syioxie[2]),
                    new Vector2(0, L + syioxie[1])
                ];

                holes = [];
                kongpoint = [];
                for (i = 0; i < zkkw.length; i++) {
                    xv = BKH - BKKJMDis;
                    yv = zkkw[i];

                    if (p_xzxqtype === XQType.spnx) {
                        if (yv < XQNXJL + BKDia / 2) {
                            continue;
                        }
                    }
                    if (p_syxqtype === XQType.spnx) {

                        if (yv > L - XQNXJL - BKDia / 2) {
                            continue;
                        }
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);
                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }

                if (p_zksctype === XQType.normal) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, leftPath, holes, AK.p_zkkw, data.kongpoint,
                        (a, b) => new Vector3(a - b * ztanB, b, W),
                        (a, b) => new Vector3(a - b * ztanB, b, W - ZYKH),
                        (a, b) => [a - b * ztanB, b, W],
                        (a, b) => [a - b * ztanB, b, W - ZYKH],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - b * ztanB, b, W])
                    );
                }
                else if (p_zksctype === XQType.nx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, leftPath, holes, AK.p_zkkw, data.kongpoint,
                        (a, b) => new Vector3(a - b * ztanB, b, W - a * cosA),
                        (a, b) => new Vector3(a - b * ztanB, b, W - ZYKH - a * cosA),
                        (a, b) => [a - b * ztanB, b, W - a * cosA],
                        (a, b) => [a - b * ztanB, b, W - ZYKH - a * cosA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - b * ztanB, b, W - a * cosA])
                    );
                }
                else if (p_zksctype === XQType.wx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, leftPath, holes, AK.p_zkkw, data.kongpoint,
                        (a, b) => new Vector3(a - b * ztanB, b, W + a * cosA),
                        (a, b) => new Vector3(a - b * ztanB, b, W - ZYKH + a * cosA),
                        (a, b) => [a - b * ztanB, b, W + a * cosA],
                        (a, b) => [a - b * ztanB, b, W - ZYKH + a * cosA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - b * ztanB, b, W + a * cosA])
                    );
                }

            }


            // 上下封板
            WC = CommonUtils.SqrtValue(XQNXJL, W);

            // 顶面
            if (p_syfentype !== XQType.none) {

                HC = CommonUtils.SqrtValue(XQNXJL, p_th);

                // 封板孔
                let zypk = AModelFmulaUtils.getHolesbyExpress(data.p_zypkk, W, 2,);
                let yypk = AModelFmulaUtils.getHolesbyExpress(data.p_yypkk, p_th, 2);

                holes = [];
                kongpoint = [];
                // 左平孔-宽
                for (i = 0; i < zypk.length; i++) {
                    xv = BKH - BKKJMDis - zcha;
                    yv = zypk[i];
                    if (yv > W - BKDia / 2) {
                        continue;
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }

                // 右平孔-高
                for (i = 0; i < yypk.length; i++) {
                    xv = yypk[i] - zcha;
                    yv = BKH - BKKJMDis;
                    if (xv > p_th - BKDia / 2) {
                        continue;
                    }
                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }



                let topPath: Vector2[];
                if (p_syfentype === XQType.sj) {

                    topPath = [
                        new Vector2(fbsj * zsinB - zcha, 0),
                        new Vector2(fbsj * zsinB - zcha, W),
                        new Vector2(fbsj * zsinB + BKH - zcha, W + zxval),
                        new Vector2(fbsj * zsinB + BKH - zcha, BKH),
                        new Vector2(minH + yxval, BKH),
                        new Vector2(minH, 0)
                    ];

                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, holes, "p_fbk", data.kongpoint,
                        (a, b) => new Vector3(a, L - fbsj, b),
                        (a, b) => new Vector3(a, L - fbsj - SXKH, b),
                        (a, b) => [a, L - fbsj, b],
                        (a, b) => [a, L - fbsj - SXKH, b],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, L - fbsj, b])
                    );
                }
                else {
                    if (p_syxqtype === XQType.czwx || p_syxqtype === XQType.cznx) {

                        tanB = p_syxqtype === XQType.cznx ? -XQNXJL / p_th : XQNXJL / p_th;

                        topPath = p_syfentype === XQType.mf ? [
                            new Vector2(-zcha, 0),
                            new Vector2(-zcha, W),
                            new Vector2(p_bh, W),
                            new Vector2(p_bh, 0)
                        ] : [
                            new Vector2(-zcha, 0),
                            new Vector2(-zcha, W),
                            new Vector2((-zcha + BKH), W + zxval),
                            new Vector2((-zcha + BKH), BKH),
                            new Vector2((p_bh + yxval), BKH),
                            new Vector2(p_bh, 0)
                        ]


                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, L + (a + zcha) * tanB, b),
                            (a, b) => new Vector3(a, L + (a + zcha) * tanB - SXKH, b),
                            (a, b) => [a, L + (a + zcha) * tanB, b],
                            (a, b) => [a, L + (a + zcha) * tanB - SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, L + (a + zcha) * tanB, b])
                        );
                    }
                    else if (p_syxqtype === XQType.spwx || p_syxqtype === XQType.spnx) {

                        tanB = p_syxqtype === XQType.spnx ? -XQNXJL / W : XQNXJL / W;
                        topPath = p_syfentype === XQType.mf ? [
                            new Vector2(-zcha, 0),
                            new Vector2(-zcha, W),
                            new Vector2(p_bh + W * tanB * ztanB, W),
                            new Vector2(p_bh, 0)
                        ] : [
                            new Vector2(-zcha, 0),
                            new Vector2(-zcha, W),
                            new Vector2((-zcha + BKH), (W + zxval)),
                            new Vector2((-zcha + BKH), BKH),
                            new Vector2((p_bh + yxval + BKH * tanB * ztanB), BKH),
                            new Vector2(p_bh, 0)
                        ]


                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a - b * tanB * ztanB, L + b * tanB, b),
                            (a, b) => new Vector3(a - b * tanB * ztanB, L + b * tanB - SXKH, b),
                            (a, b) => [a - b * tanB * ztanB, L + b * tanB, b],
                            (a, b) => [a - b * tanB * ztanB, L + b * tanB - SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - b * tanB * ztanB, L + b * tanB, b])
                        );

                    }
                    else {

                        topPath = p_syfentype === XQType.mf ? [
                            new Vector2(-zcha, 0),
                            new Vector2(-zcha, W),
                            new Vector2(minH, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(-zcha, 0),
                            new Vector2(-zcha, W),
                            new Vector2(-zcha + BKH, W + zxval),
                            new Vector2(p_bh - maxH + BKH, BKH),
                            new Vector2(minH + yxval, BKH),
                            new Vector2(minH, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, p_syfentype === XQType.mf ? null : holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, L, b),
                            (a, b) => new Vector3(a, L - SXKH, b),
                            (a, b) => [a, L, b],
                            (a, b) => [a, L - SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, L, b])
                        );
                    }
                }
            }

            // 底面
            if (p_xzfentype !== XQType.none) {

                HC = CommonUtils.SqrtValue(XQNXJL, p_bh);


                let zypk = AModelFmulaUtils.getHolesbyExpress(data.p_zypkk, W, 2);
                let yypk = AModelFmulaUtils.getHolesbyExpress(data.p_yypkk, p_bh, 2);

                holes = [];
                kongpoint = [];
                // 左平孔-宽
                for (i = 0; i < zypk.length; i++) {
                    xv = BKH - BKKJMDis;
                    yv = zypk[i];
                    if (yv > W - BKDia / 2) {
                        continue;
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }

                // 右平孔-高
                for (i = 0; i < yypk.length; i++) {
                    xv = yypk[i];
                    yv = BKH - BKKJMDis;
                    if (xv > p_bh - BKDia / 2) {
                        continue;
                    }
                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }


                let bottomPath: Vector2[];

                if (p_xzfentype === XQType.sj) {

                    bottomPath = [
                        new Vector2(-fbsj * zsinB, 0),
                        new Vector2(-fbsj * zsinB, W),
                        new Vector2(-fbsj * zsinB + BKH, W + zxval),
                        new Vector2(-fbsj * zsinB + BKH, BKH),
                        new Vector2(p_bh + yxval, BKH),
                        new Vector2(p_bh, 0)
                    ];

                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, holes, "p_fbk", data.kongpoint,
                        (a, b) => new Vector3(a, fbsj, b),
                        (a, b) => new Vector3(a, fbsj + SXKH, b),
                        (a, b) => [a, fbsj, b],
                        (a, b) => [a, fbsj + SXKH, b],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, fbsj, b])
                    );
                }
                else {

                    if (p_xzxqtype === XQType.czwx || p_xzxqtype === XQType.cznx) {

                        tanB = p_xzxqtype === XQType.czwx ? -XQNXJL / p_bh : XQNXJL / p_bh;
                        bottomPath = p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(p_bh, W),
                            new Vector2(p_bh, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(BKH, W + zxval),
                            new Vector2(BKH, BKH),
                            new Vector2((p_bh + yxval), BKH),
                            new Vector2(p_bh, 0)
                        ];


                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, a * tanB, b),
                            (a, b) => new Vector3(a, SXKH + a * tanB, b),
                            (a, b) => [a, a * tanB, b],
                            (a, b) => [a, SXKH + a * tanB, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, a * tanB, b])
                        );
                    }
                    else if (p_xzxqtype === XQType.spwx || p_xzxqtype === XQType.spnx) {

                        tanB = p_xzxqtype === XQType.spwx ? -XQNXJL / W : XQNXJL / W;
                        bottomPath = p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(p_bh + W * tanB * ztanB, W),
                            new Vector2(p_bh, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(BKH, (W + zxval)),
                            new Vector2(BKH, BKH),
                            new Vector2((p_bh + yxval) + BKH * tanB * ztanB, BKH),
                            new Vector2(p_bh, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a - b * tanB * ztanB, b * tanB, b),
                            (a, b) => new Vector3(a - b * tanB * ztanB, SXKH + b * tanB, b),
                            (a, b) => [a - b * tanB * ztanB, b * tanB, b],
                            (a, b) => [a - b * tanB * ztanB, SXKH + b * tanB, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - b * tanB * ztanB, b * tanB, b])
                        );
                    }
                    else {

                        bottomPath = p_xzfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(p_bh, W),
                            new Vector2(p_bh, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(BKH, W + zxval),
                            new Vector2(BKH, BKH),
                            new Vector2(p_bh + yxval, BKH),
                            new Vector2(p_bh, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, p_xzfentype === XQType.mf ? null : holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, 0, b),
                            (a, b) => new Vector3(a, SXKH, b),
                            (a, b) => [a, 0, b],
                            (a, b) => [a, SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, 0, b])
                        );
                    }

                }
            }

            // 易拆
            if (p_yctype === 3 && Number(data.xqbj) > 0 && Number(data.zyxqjl) > 0) {

                let zyxqjl = +data.zyxqjl;
                let xqbj = + data.xqbj;

                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    xqbj, SXKH, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia, false, true);

                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    L - xqbj, SXKH, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia, true, true);
            }
            else if (data.p_yctype === 2) {
                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    L / 2, SXKH, YCJL, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia, true, true);
            }
            else if (data.p_yctype === 1) {
                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    L / 2, SXKH, YCJL, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia, false, true);
            }

        }
        else {

            data.duan = [
                -zcha, 0, W,
                -zcha, 0, 0,
                minH, 0, 0,

                0, L, 0,
                minH, L, 0,
                0, L, W
            ];

            if (p_xzfentype === XQType.sj) {
                data.duan.push(
                    -(L - fbsj) * ztanB, fbsj, W,
                    -(L - fbsj) * ztanB, fbsj, 0,
                    minH, fbsj, 0,
                )
            }
            else {
                data.duan.push(
                    -(L - 50) * ztanB, 50, W,
                    -(L - 50) * ztanB, 50, 0,
                    minH, 50, 0,
                    -(L - 100) * ztanB, 100, 0
                )
            }

            if (p_syfentype === XQType.sj) {
                data.duan.push(
                    -(fbsj) * ztanB, L - fbsj, W,
                    -(fbsj) * ztanB, L - fbsj, 0,
                    minH, L - fbsj, 0,
                )
            }
            else {
                data.duan.push(
                    -(50) * ztanB, L - 50, W,
                    -(50) * ztanB, L - 50, 0,
                    minH, L - 50, 0,
                    -(100) * ztanB, L - 100, 0
                )
            }


            data.zhong = {
                L: [
                    {
                        pointer: [minH / 2, L, 0],
                        center: [minH / 2, L / 2, 0],

                    },
                    {
                        pointer: [0, L, W / 2],
                        center: [0, L / 2, W / 2],

                    }
                ],
                RL: [
                    {
                        pointer: [minH / 2, 0, 0],
                        center: [minH / 2, L / 2, 0],
                        dir: [0, 0, 0]
                    },
                    {
                        pointer: [-zcha, 0, W / 2],
                        center: [-zcha, L / 2, W / 2],
                    }
                ],

                W: [
                    {
                        pointer: [-L / 2 * ztanB, L / 2, W],
                        center: [-L / 2 * ztanB, L / 2, W / 2],

                    }
                ],

                minH: [
                    {
                        pointer: [minH, L / 2, 0],
                        center: [minH / 2, L / 2, 0],
                    }
                ]
            }

            // 左侧面孔
            let zgmpath = [
                new Vector2(0 + xzioxie[0], 0),
                new Vector2(0 + xzioxie[1], W),
                new Vector2(zgmL + syioxie[1], W),
                new Vector2(zgmL + syioxie[0], 0)
            ];

            let zlen = p_zksctype === XQType.nx ? -data.GMT / tanA : p_zksctype === XQType.wx ? data.GMT / tanA : 0;

            // 左缺口
            let leftpathv = SlotUtils.getLeftObliqueSlotGapPath(data, xzioxie, syioxie, zgmL, W, zlen, QKH, QKW, p_lpck, p_lpch, zcosB, data.p_zkqkdw, zklpcdw, false);

            if (CommonUtils.haveData(leftpathv) && QKH < W) {
                zgmpath = leftpathv[0];
                zgmpath.pop();
            }

            let zspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_zspkfa], W, 2, null, null, 10008);
            let zgmkw: string = "";
            if (data.p_xzfentype === XQType.sj) {
                for (let i = 0; i < zspkfa.length; i++) {

                    xv = p_kbj;
                    yv = zspkfa[i];

                    zgmkw += "(" + yv + "," + xv + ")";
                }
            }

            if (data.p_syfentype === XQType.sj) {
                for (let i = 0; i < zspkfa.length; i++) {
                    xv = L - p_kbj;
                    yv = zspkfa[i];

                    zgmkw += "(" + yv + "," + xv + ")";
                }
            }

            if (zgmkw !== "") {
                data.p_l_r3 = kkzj.toString();
                data.p_l_r3dw = zgmkw;
            }

            data.p_l_r1 = CommonUtils.checkRadiusIsLegal(data.p_l_r1);
            data.p_l_r2 = CommonUtils.checkRadiusIsLegal(data.p_l_r2);
            data.p_l_r3 = CommonUtils.checkRadiusIsLegal(data.p_l_r3);

            data.p_l_r1dw = CommonUtils.fliterOuterPoint(data.p_l_r1dw, zgmpath, true, false, false, true, data.p_l_r1.toString());
            data.p_l_r2dw = CommonUtils.fliterOuterPoint(data.p_l_r2dw, zgmpath, true, false, false, true, data.p_l_r2.toString());
            data.p_l_r3dw = CommonUtils.fliterOuterPoint(data.p_l_r3dw, zgmpath, true, false, false, true, data.p_l_r3.toString());


            holes = [];
            CommonUtils.getGmtHoles(data.p_l_r1, data.p_l_r1dw, holes, 1);
            CommonUtils.getGmtHoles(data.p_l_r2, data.p_l_r2dw, holes, 1);
            CommonUtils.getGmtHoles(data.p_l_r3, data.p_l_r3dw, holes, 1);

            CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint, 0, false, false, false, (a, b) => [a * zsinB - zcha, a * zcosB, b]);

            let xc = L * zsinB;
            let xd = xc * zcosB;
            let yd = -xc * zsinB;
            let lnor = new Vector3(xd, yd, 0).normalize();
            data.gmholes.push(SlotUtils.getCHolesData(data.p_l_r1, data.p_l_r1dw, zsinB, zcosB, zcha, L, lnor.clone(), true));
            data.gmholes.push(SlotUtils.getCHolesData(data.p_l_r2, data.p_l_r2dw, zsinB, zcosB, zcha, L, lnor.clone(), true));
            data.gmholes.push(SlotUtils.getCHolesData(data.p_l_r3, data.p_l_r3dw, zsinB, zcosB, zcha, L, lnor.clone(), true));

            count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, zgmpath, holes, AK.p_l_r1dw, data.kongpoint,
                (a, b) => new Vector3(a * zsinB - zcha, a * zcosB, b),
                (a, b) => new Vector3(a * zsinB + GMT - zcha, a * zcosB, b),
                (a, b) => [a * zsinB - zcha, a * zcosB, b],
                (a, b) => [a * zsinB + GMT - zcha, a * zcosB, b],
            );


            // 右侧面孔
            let ygmpath = [
                new Vector2(-zcha, 0 + xzioxie[0]),
                new Vector2(minH, 0 + xzioxie[5]),
                new Vector2(minH, L + syioxie[5]),
                new Vector2(0, L + syioxie[0])
            ];

            // 右缺口
            let YL = p_yksctype === XQType.nx ? -GMT / tanA : p_yksctype === XQType.wx ? GMT / tanA : 0;
            let rightpathv = SlotUtils.getRightObliqueSlotGapPath(data, xzioxie, syioxie, L, minH, YL, zcha, QKH, QKW, p_lpck, p_lpch, data.p_ykqkdw, yklpcdw, false);
            if (CommonUtils.haveData(rightpathv) && QKH < minH) {
                ygmpath = rightpathv[0];
                ygmpath.pop();
            }

            let yspkfa: any[];
            let ygmkw: string = "";
            if (data.p_xzfentype === XQType.sj) {
                yspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_yspkfa], p_th, 2, null, null, 10008);
                for (let i = 0; i < yspkfa.length; i++) {
                    xv = yspkfa[i];
                    yv = p_kbj;
                    ygmkw += "(" + xv + "," + yv + ")";
                }
            }

            if (data.p_syfentype === XQType.sj) {
                yspkfa = AModelFmulaUtils.getHolesbyExpress(data[AK.p_yspkfa], p_bh, 2, null, null, 10008);
                for (let i = 0; i < yspkfa.length; i++) {
                    xv = yspkfa[i];
                    yv = L - p_kbj;
                    ygmkw += "(" + xv + "," + yv + ")";
                }
            }

            if (ygmkw !== "") {
                data.p_r_r3 = kkzj.toString();
                data.p_r_r3dw = ygmkw;
            }

            data.p_r_r1 = CommonUtils.checkRadiusIsLegal(data.p_r_r1);
            data.p_r_r2 = CommonUtils.checkRadiusIsLegal(data.p_r_r2);
            data.p_r_r3 = CommonUtils.checkRadiusIsLegal(data.p_r_r3);

            data.p_r_r1dw = CommonUtils.fliterOuterPoint(data.p_r_r1dw, ygmpath, false, false, false, true, data.p_r_r1.toString());
            data.p_r_r2dw = CommonUtils.fliterOuterPoint(data.p_r_r2dw, ygmpath, false, false, false, true, data.p_r_r2.toString());
            data.p_r_r3dw = CommonUtils.fliterOuterPoint(data.p_r_r3dw, ygmpath, false, false, false, true, data.p_r_r3.toString());


            holes = [];
            CommonUtils.getGmtHoles(data.p_r_r1, data.p_r_r1dw, holes);
            CommonUtils.getGmtHoles(data.p_r_r2, data.p_r_r2dw, holes);
            CommonUtils.getGmtHoles(data.p_r_r3, data.p_r_r3dw, holes);

            // 添加光面孔位
            CommonUtils.getGMTHolesToKongPoint(holes, data.kongpoint);

            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r1, data.p_r_r1dw, 0, ConstDef.znormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r2, data.p_r_r2dw, 0, ConstDef.znormal.clone()));
            data.gmholes.push(CommonUtils.getHolesData(data.p_r_r3, data.p_r_r3dw, 0, ConstDef.znormal.clone()));

            count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, ygmpath, holes, AK.p_r_r1dw, data.kongpoint,
                (a, b) => new Vector3(a, b, 0),
                (a, b) => new Vector3(a, b, GMT),
                (a, b) => [a, b, 0],
                (a, b) => [a, b, GMT],
            );


            // 右边框
            let ykkw = AModelFmulaUtils.getHolesbyExpress(data.p_ykkw, L, 2, data, AK.p_ykkw);

            let ylen = p_yksctype === XQType.normal ? BKH : BKH / sinA;

            // 右缺口
            // 缺口值
            let ylpkw = []
            let rightpv = SlotUtils.getNormalSlotRightGapPath(false, data, ylen, 0, 0, xzioxie, syioxie, true, ylpkw);
            let rigthqkvec = [rightpv.front, rightpv.back, rightpv.frontlp, rightpv.backlp];
            if (CommonUtils.haveData(rigthqkvec)) {

                if (QKH > 0 && QKW > 0 && QKH < H) {
                    for (i = 0; i < rigthqkvec[0].length; i++) {

                        let fone = rigthqkvec[0][i].concat();
                        let bone = rigthqkvec[1][i].concat();

                        let minvecx = CommonUtils.getVectorMinX(fone, bone);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < ykkw.length; j++) {
                            xv = ykkw[j];
                            yv = BKH - BKKJMDis;

                            if (xv > minvecx[0] - data.BKDia / 2 || xv < minvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;


                            return [minH + c * kadv, b, c * kra];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getRightSlotFengVI(count, vertices, indices, facevec, fone, bone, holes, minH, cosA, sinA, data, AK.p_ykkw);

                    }
                }
                if (rigthqkvec[2].length > 0 && rigthqkvec[3].length > 0) {
                    for (i = 0; i < rigthqkvec[2].length; i++) {

                        let rlpfone = rigthqkvec[2][i].concat();
                        let rlpbone = rigthqkvec[3][i].concat();

                        let rlpminvecx = CommonUtils.getVectorMinX(rlpfone, rlpbone);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < ykkw.length; j++) {
                            xv = ykkw[j];
                            yv = BKH - BKKJMDis;

                            if (xv > rlpminvecx[0] - data.BKDia / 2 || xv < rlpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);

                            holes.push(holePath);

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            return [minH + c * kadv - p_lpch, b, c * kra];
                        });
                        data.kongpoint.push(...kongpoint);

                        count = SlotUtils.getRightSlotFengVI(count, vertices, indices, facevec, rlpfone, rlpbone, holes, minH, cosA, sinA, data, AK.p_ykkw, true, p_lpch);
                        // 右拉片槽定位

                        kongpoint = [];
                        for (let j = 0; j < ylpkw.length; j++) {
                            xv = ylpkw[j];
                            yv = BKH - BKKJMDis;

                            if (xv > rlpminvecx[0] - data.BKDia / 2 || xv < rlpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.cznx) {
                                if (xv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.cznx) {

                                if (xv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            kongpoint.push(0, xv, yv);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => {

                            let kadv = data.p_yksctype === XQType.nx ? - cosA : data.p_yksctype === XQType.wx ? cosA : 0;
                            let kra = data.p_yksctype === XQType.normal ? 1 : sinA;
                            return [minH + c * kadv - p_lpch, b, c * kra];
                        });
                        data.lpcdw.push({ key: AK.p_yklpcdw, dw: [...kongpoint], dir: [1, 0, 0] })
                    }

                }

            }
            else {
                let rightPath = [
                    new Vector2(0 + xzioxie[5], 0),
                    new Vector2(0 + xzioxie[4], ylen),
                    new Vector2(L + syioxie[4], ylen),
                    new Vector2(L + syioxie[5], 0)
                ];

                // 右框孔位
                holes = [];
                kongpoint = [];
                for (i = 0; i < ykkw.length; i++) {
                    xv = ykkw[i];
                    yv = BKH - BKKJMDis;

                    if (p_xzxqtype === XQType.cznx) {
                        if (xv < XQNXJL + BKDia / 2) {
                            continue;
                        }
                    }
                    if (p_syxqtype === XQType.cznx) {
                        if (xv > L - XQNXJL - BKDia / 2) {
                            continue;
                        }
                    }

                    holePath = new Path();
                    holePath.moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);
                    kongpoint.push(xv, yv, 0);
                }

                if (p_yksctype === XQType.normal) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, rightPath, holes, AK.p_ykkw, data.kongpoint,
                        (a, b) => new Vector3(minH, a, b),
                        (a, b) => new Vector3(minH - ZYKH, a, b),
                        (a, b) => [minH, a, b],
                        (a, b) => [minH - ZYKH, a, b],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [minH, a, b])
                    );
                }
                else if (p_yksctype === XQType.nx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, rightPath, holes, AK.p_ykkw, data.kongpoint,
                        (a, b) => new Vector3(minH - b * cosA, a, b * sinA),
                        (a, b) => new Vector3(minH - ZYKH - b * cosA, a, b * sinA),
                        (a, b) => [minH - b * cosA, a, b * sinA],
                        (a, b) => [minH - ZYKH - b * cosA, a, b * sinA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [minH - b * cosA, a, b * sinA])
                    );
                }
                else if (p_yksctype === XQType.wx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, rightPath, holes, AK.p_ykkw, data.kongpoint,
                        (a, b) => new Vector3(minH + b * cosA, a, b * sinA),
                        (a, b) => new Vector3(minH - ZYKH + b * cosA, a, b * sinA),
                        (a, b) => [minH + b * cosA, a, b * sinA],
                        (a, b) => [minH - ZYKH + b * cosA, a, b * sinA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [minH + b * cosA, a, b * sinA])
                    );
                }
            }


            // 左边框
            let ZL = p_zksctype === XQType.normal ? BKH : BKH / sinA;
            let zkkw = AModelFmulaUtils.getHolesbyExpress(data.p_zkkw, L, 2, data, AK.p_zkkw);

            let leftLpdw = [];
            let leftpv = SlotUtils.getObliqueSlotLeftBKPath(data, L, ZL, QKH, QKW, p_lpck, xzioxie, syioxie, data.p_zkqkdw, leftLpdw);
            let leftqkvec = [leftpv.front, leftpv.back, leftpv.frontlp, leftpv.backlp];

            if (CommonUtils.haveData(leftqkvec)) {

                if (QKH > 0 && QKW > 0 && QKH < W) {
                    for (i = 0; i < leftqkvec[0].length; i++) {

                        let fone = leftqkvec[0][i].concat();
                        let bone = leftqkvec[1][i].concat();

                        let minvecx = CommonUtils.getVectorMinX(fone, bone, true);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < zkkw.length; j++) {
                            xv = BKH - BKKJMDis;
                            yv = zkkw[j];

                            if (yv > minvecx[0] - data.BKDia / 2 || yv < minvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < data.XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - data.XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(xv, yv, 0);
                        }

                        let kadv = p_zksctype === XQType.nx ? - cosA : p_zksctype === XQType.wx ? cosA : 0;
                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, fone, holes, AK.p_zkkw, data.kongpoint,
                            (a, b) => new Vector3((a - (L - b) * ztanB) * sinA, b, W + a * kadv),
                            (a, b) => new Vector3((a - (L - b) * ztanB) * sinA, b, W - ZYKH + a * kadv),
                            (a, b) => [(a - (L - b) * ztanB) * sinA, b, W + a * kadv],
                            (a, b) => [(a - (L - b) * ztanB) * sinA, b, W - ZYKH + a * kadv],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [(a - (L - b) * ztanB) * sinA, b, W + a * kadv])
                        );

                    }
                }

                if (leftqkvec[2].length > 0 && leftqkvec[3].length > 0) {
                    for (i = 0; i < leftqkvec[2].length; i++) {

                        let lpfone = leftqkvec[2][i].concat();
                        let lpbone = leftqkvec[3][i].concat();

                        let lpminvecx = CommonUtils.getVectorMinX(lpfone, lpbone, true);

                        holes = [];
                        kongpoint = [];
                        for (let j = 0; j < zkkw.length; j++) {
                            xv = BKH - BKKJMDis;
                            yv = zkkw[j];

                            if (yv > lpminvecx[0] - data.BKDia / 2 || yv < lpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(xv, yv, 0);
                        }


                        let kadv = p_zksctype === XQType.nx ? - cosA : p_zksctype === XQType.wx ? cosA : 0;
                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, lpfone, holes, AK.p_zkkw, data.kongpoint,
                            (a, b) => new Vector3((a - (L - b) * ztanB) * sinA, b, W + a * kadv - p_lpch),
                            (a, b) => new Vector3((a - (L - b) * ztanB) * sinA, b, W - ZYKH + a * kadv - p_lpch),
                            (a, b) => [(a - (L - b) * ztanB) * sinA, b, W + a * kadv - p_lpch],
                            (a, b) => [(a - (L - b) * ztanB) * sinA, b, W - ZYKH + a * kadv - p_lpch],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [(a - (L - b) * ztanB) * sinA, b, W + a * kadv - p_lpch])
                        );

                        // 拉片槽定位
                        kongpoint = [];
                        for (let j = 0; j < zkkw.length; j++) {
                            xv = BKH - BKKJMDis;
                            yv = zkkw[j];

                            if (yv > lpminvecx[0] - data.BKDia / 2 || yv < lpminvecx[1] + data.BKDia / 2) {
                                continue;
                            }

                            if (data.p_xzxqtype === XQType.spnx) {
                                if (yv < XQNXJL + data.BKDia / 2) {
                                    continue;
                                }
                            }
                            if (data.p_syxqtype === XQType.spnx) {

                                if (yv > L - XQNXJL - data.BKDia / 2) {
                                    continue;
                                }
                            }

                            holePath = new Path()
                                .moveTo(xv, yv)
                                .absarc(xv, yv, data.BKDia / 2, 0, Math.PI * 2, true);
                            holes.push(holePath);

                            kongpoint.push(xv, yv, 0);
                        }

                        CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [(a - (L - b) * ztanB) * sinA, b, W + a * kadv - p_lpch])
                        data.lpcdw.push({ key: AK.p_zklpcdw, dw: [...kongpoint], dir: [0, 0, 1] })

                    }
                }
            }
            else {
                let leftPath = [
                    new Vector2(0, 0 + xzioxie[1]),
                    new Vector2(BKH, 0 + xzioxie[2]),
                    new Vector2(BKH, L + syioxie[2]),
                    new Vector2(0, L + syioxie[1])
                ];

                holes = [];
                kongpoint = [];
                for (i = 0; i < zkkw.length; i++) {
                    xv = BKH - BKKJMDis;
                    yv = zkkw[i];

                    if (p_xzxqtype === XQType.spnx) {
                        if (yv < XQNXJL + BKDia / 2) {
                            continue;
                        }
                    }
                    if (p_syxqtype === XQType.spnx) {

                        if (yv > L - XQNXJL - BKDia / 2) {
                            continue;
                        }
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);
                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }
                if (p_zksctype === XQType.normal) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, leftPath, holes, AK.p_zkkw, data.kongpoint,
                        (a, b) => new Vector3(a - (L - b) * ztanB, b, W),
                        (a, b) => new Vector3(a - (L - b) * ztanB, b, W - ZYKH),
                        (a, b) => [a - (L - b) * ztanB, b, W],
                        (a, b) => [a - (L - b) * ztanB, b, W - ZYKH],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - (L - b) * ztanB, b, W])
                    );
                }
                else if (p_zksctype === XQType.nx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, leftPath, holes, AK.p_zkkw, data.kongpoint,
                        (a, b) => new Vector3(a - (L - b) * ztanB, b, W - a * cosA),
                        (a, b) => new Vector3(a - (L - b) * ztanB, b, W - ZYKH - a * cosA),
                        (a, b) => [a - (L - b) * ztanB, b, W - a * cosA],
                        (a, b) => [a - (L - b) * ztanB, b, W - ZYKH - a * cosA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - (L - b) * ztanB, b, W - a * cosA])
                    );
                }
                else if (p_zksctype === XQType.wx) {
                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, leftPath, holes, AK.p_zkkw, data.kongpoint,
                        (a, b) => new Vector3(a - (L - b) * ztanB, b, W + a * cosA),
                        (a, b) => new Vector3(a - (L - b) * ztanB, b, W - ZYKH + a * cosA),
                        (a, b) => [a - (L - b) * ztanB, b, W + a * cosA],
                        (a, b) => [a - (L - b) * ztanB, b, W - ZYKH + a * cosA],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a - (L - b) * ztanB, b, W + a * cosA])
                    );
                }

            }

            // 上下封板
            WC = CommonUtils.SqrtValue(XQNXJL, W);

            // 顶面
            if (p_syfentype !== XQType.none) {

                HC = CommonUtils.SqrtValue(XQNXJL, p_th);

                // 封板孔
                let zypk = AModelFmulaUtils.getHolesbyExpress(data.p_zypkk, W, 2,);
                let yypk = AModelFmulaUtils.getHolesbyExpress(data.p_yypkk, p_th, 2);

                holes = [];
                kongpoint = [];
                // 左平孔-宽
                for (i = 0; i < zypk.length; i++) {
                    xv = BKH - BKKJMDis;
                    yv = zypk[i];
                    if (yv > W - BKDia / 2) {
                        continue;
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }

                // 右平孔-高
                for (i = 0; i < yypk.length; i++) {
                    xv = yypk[i];
                    yv = BKH - BKKJMDis;
                    if (xv > p_th - BKDia / 2) {
                        continue;
                    }
                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }


                let topPath: Vector2[];
                if (p_syfentype === XQType.sj) {

                    topPath = [
                        new Vector2(-fbsj * zsinB, 0),
                        new Vector2(-fbsj * zsinB, W),
                        new Vector2(-fbsj * zsinB + BKH, W + zxval),
                        new Vector2(-fbsj * zsinB + BKH, BKH),
                        new Vector2(minH + yxval, BKH),
                        new Vector2(minH, 0)
                    ];

                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, holes, "p_fbk", data.kongpoint,
                        (a, b) => new Vector3(a, L - fbsj, b),
                        (a, b) => new Vector3(a, L - fbsj - SXKH, b),
                        (a, b) => [a, L - fbsj, b],
                        (a, b) => [a, L - fbsj - SXKH, b],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, L - fbsj, b])
                    );
                }
                else {
                    if (p_syxqtype === XQType.czwx || p_syxqtype === XQType.cznx) {

                        tanB = p_syxqtype === XQType.cznx ? -XQNXJL / p_th : XQNXJL / p_th;

                        topPath = p_syfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(minH, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(BKH, W + zxval),
                            new Vector2(BKH, BKH),
                            new Vector2(minH + yxval, BKH),
                            new Vector2(minH, 0)
                        ]


                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, L + a * tanB, b),
                            (a, b) => new Vector3(a, L + a * tanB - SXKH, b),
                            (a, b) => [a, L + a * tanB, b],
                            (a, b) => [a, L + a * tanB - SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, L + a * tanB, b])
                        );
                    }
                    else if (p_syxqtype === XQType.spwx || p_syxqtype === XQType.spnx) {

                        tanB = p_syxqtype === XQType.spnx ? -XQNXJL / W : XQNXJL / W;
                        topPath = p_syfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(minH - W * tanB * ztanB, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(BKH, (W + zxval)),
                            new Vector2(BKH, BKH),
                            new Vector2((minH + yxval - BKH * tanB * ztanB), BKH),
                            new Vector2(minH, 0)
                        ]


                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a + b * tanB * ztanB, L + b * tanB, b),
                            (a, b) => new Vector3(a + b * tanB * ztanB, L + b * tanB - SXKH, b),
                            (a, b) => [a + b * tanB * ztanB, L + b * tanB, b],
                            (a, b) => [a + b * tanB * ztanB, L + b * tanB - SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a + b * tanB * ztanB, L + b * tanB, b])
                        );

                    }
                    else {

                        topPath = p_syfentype === XQType.mf ? [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(minH, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(0, 0),
                            new Vector2(0, W),
                            new Vector2(BKH, W + zxval),
                            new Vector2(BKH, BKH),
                            new Vector2(minH + yxval, BKH),
                            new Vector2(minH, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, topPath, p_syfentype === XQType.mf ? null : holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, L, b),
                            (a, b) => new Vector3(a, L - SXKH, b),
                            (a, b) => [a, L, b],
                            (a, b) => [a, L - SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, L, b])
                        );
                    }
                }
            }

            // 底面
            if (p_xzfentype !== XQType.none) {

                HC = CommonUtils.SqrtValue(XQNXJL, p_bh);

                let zypk = AModelFmulaUtils.getHolesbyExpress(data.p_zypkk, W, 2);
                let yypk = AModelFmulaUtils.getHolesbyExpress(data.p_yypkk, p_bh, 2);

                holes = [];
                kongpoint = [];
                // 左平孔-宽
                for (i = 0; i < zypk.length; i++) {
                    xv = BKH - BKKJMDis - zcha;
                    yv = zypk[i];
                    if (yv > W - BKDia / 2) {
                        continue;
                    }

                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }

                // 右平孔-高
                for (i = 0; i < yypk.length; i++) {
                    xv = yypk[i] - zcha;
                    yv = BKH - BKKJMDis;
                    if (xv > p_bh - BKDia / 2) {
                        continue;
                    }
                    holePath = new Path()
                        .moveTo(xv, yv)
                        .absarc(xv, yv, BKDia / 2, 0, Math.PI * 2, true);

                    holes.push(holePath);

                    kongpoint.push(xv, yv, 0);
                }


                let bottomPath: Vector2[];

                if (p_xzfentype === XQType.sj) {

                    bottomPath = [
                        new Vector2(fbsj * zsinB - zcha, 0),
                        new Vector2(fbsj * zsinB - zcha, W),
                        new Vector2(fbsj * zsinB - zcha + BKH, W + zxval),
                        new Vector2(fbsj * zsinB - zcha + BKH, BKH),
                        new Vector2(minH + yxval, BKH),
                        new Vector2(minH, 0)
                    ];

                    count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, holes, "p_fbk", data.kongpoint,
                        (a, b) => new Vector3(a, fbsj, b),
                        (a, b) => new Vector3(a, fbsj + SXKH, b),
                        (a, b) => [a, fbsj, b],
                        (a, b) => [a, fbsj + SXKH, b],
                        () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, fbsj, b])
                    );
                }
                else {

                    if (p_xzxqtype === XQType.czwx || p_xzxqtype === XQType.cznx) {

                        tanB = p_xzxqtype === XQType.czwx ? -XQNXJL / p_bh : XQNXJL / p_bh;
                        bottomPath = p_xzfentype === XQType.mf ? [
                            new Vector2(- zcha, 0),
                            new Vector2(- zcha, W),
                            new Vector2(minH, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(- zcha, 0),
                            new Vector2(- zcha, W),
                            new Vector2(- zcha + BKH, W + zxval),
                            new Vector2(- zcha + BKH, BKH),
                            new Vector2((minH + yxval), BKH),
                            new Vector2(minH, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, (a + zcha) * tanB, b),
                            (a, b) => new Vector3(a, SXKH + (a + zcha) * tanB, b),
                            (a, b) => [a, (a + zcha) * tanB, b],
                            (a, b) => [a, SXKH + (a + zcha) * tanB, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, (a + zcha) * tanB, b])
                        );
                    }
                    else if (p_xzxqtype === XQType.spwx || p_xzxqtype === XQType.spnx) {

                        tanB = p_xzxqtype === XQType.spwx ? -XQNXJL / W : XQNXJL / W;
                        bottomPath = p_xzfentype === XQType.mf ? [
                            new Vector2(- zcha, 0),
                            new Vector2(- zcha, W),
                            new Vector2(minH - W * tanB * ztanB, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(- zcha, 0),
                            new Vector2(- zcha, W),
                            new Vector2(- zcha + BKH, (W + zxval)),
                            new Vector2(- zcha + BKH, BKH),
                            new Vector2((minH + yxval) - BKH * tanB * ztanB, BKH),
                            new Vector2(minH, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a + b * tanB * ztanB, b * tanB, b),
                            (a, b) => new Vector3(a + b * tanB * ztanB, SXKH + b * tanB, b),
                            (a, b) => [a + b * tanB * ztanB, b * tanB, b],
                            (a, b) => [a + b * tanB * ztanB, SXKH + b * tanB, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a + b * tanB * ztanB, b * tanB, b])
                        );
                    }
                    else {

                        bottomPath = p_xzfentype === XQType.mf ? [
                            new Vector2(- zcha, 0),
                            new Vector2(- zcha, W),
                            new Vector2(minH, W),
                            new Vector2(minH, 0)
                        ] : [
                            new Vector2(- zcha, 0),
                            new Vector2(- zcha, W),
                            new Vector2(- zcha + BKH, W + zxval),
                            new Vector2(- zcha + BKH, BKH),
                            new Vector2(minH + yxval, BKH),
                            new Vector2(minH, 0)
                        ];

                        count = CommonUtils.getShapeFunctionVI(count, vertices, indices, facevec, bottomPath, p_xzfentype === XQType.mf ? null : holes, "p_fbk", data.kongpoint,
                            (a, b) => new Vector3(a, 0, b),
                            (a, b) => new Vector3(a, SXKH, b),
                            (a, b) => [a, 0, b],
                            (a, b) => [a, SXKH, b],
                            () => CommonUtils.dealHole(kongpoint, (a: number, b: number, c: number) => [a, 0, b])
                        );
                    }

                }
            }

            // 易拆
            if (p_yctype === 3 && Number(data.xqbj) > 0 && Number(data.zyxqjl) > 0) {

                let zyxqjl = +data.zyxqjl;
                let xqbj = + data.xqbj;

                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    xqbj, SXKH, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia);

                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    L - xqbj, SXKH, zyxqjl, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia, true);

            }
            else if (data.p_yctype === 2) {
                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    L / 2, SXKH, YCJL, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia, true);

            }
            else if (data.p_yctype === 1) {
                count = SlotUtils.getObliqueSlotYichaiVI(count, vertices, indices, facevec, p_bh, W, BKH,
                    L / 2, SXKH, YCJL, ztanB, zcosB, zxval, yxval, zcha, data.p_zypkk, data.p_yypkk, BKKJMDis, BKDia);

            }
        }

        // 易拆
        // 横肋
        let p_hldw = data.p_hldw;
        let HLW = +data.HLW;
        let HLH = +data.HLH;

        let hldw = AModelFmulaUtils.getHolesbyExpress(p_hldw, L, 2, data, AK.p_hldw);
        if (HLW && HLW > 0 && hldw && hldw.length > 0) {

            let hlpath: Vector2[];

            let pos: number, tt: number;
            for (let i = 0; i < hldw.length; i++) {
                pos = hldw[i];

                hlpath = isTopMax ? [
                    new Vector2(-pos * zsinB + GMT, GMT),
                    new Vector2(-pos * zsinB + GMT, W - ZYKH),
                    new Vector2(-pos * zsinB + BKH, W + zxval - ZYKH),
                    new Vector2(-pos * zsinB + BKH, BKH),
                    new Vector2(minH + yxval - ZYKH, BKH),
                    new Vector2(minH - ZYKH, 0)
                ] : [
                    new Vector2(pos * zsinB - zcha + GMT, 0),
                    new Vector2(pos * zsinB - zcha + GMT, W - ZYKH),
                    new Vector2(pos * zsinB + BKH - zcha, W + zxval - ZYKH),
                    new Vector2(pos * zsinB + BKH - zcha, BKH),
                    new Vector2(minH + yxval - ZYKH, BKH),
                    new Vector2(minH - ZYKH, 0)
                ]

                if (BIM.simpleMold) {
                    let hlface = [];
                    for (tt = 0; tt < hlpath.length; tt++) {
                        hlface.push(new Vector3(hlpath[tt].x, pos, hlpath[tt].y))
                    }
                    count = CommonUtils.getFaceByFunction(count, vertices, indices, facevec, hlface, hlpath, null, null,
                        (a: number, b: number) => [a, pos, b]);
                }
                else {
                    count = CommonUtils.getShapeVI(count, vertices, indices, facevec, hlpath, null,
                        2, pos + HLW / 2, pos - HLW / 2, false, null);
                }

            }
        }

        return [vertices, indices, facevec];
    }




}